Problem/Motivation

Please line-break the logout message.

Steps to reproduce

  1. Visit /admin/config/system/redirect_after_logout page
  2. Set something redirect destination and message:
    Line 1.
    Line 2.
    
    Line 3.
    
  3. Logout user
  4. Message is visible, but not line-wrapped, result:
    Line 1. Line 2. Line 3.
Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

nevergone created an issue. See original summary.

nevergone’s picture

Issue summary: View changes
nevergone’s picture

Issue tags: +Novice

Yujiman85 made their first commit to this issue’s fork.

mehul.gada’s picture

StatusFileSize
new1.02 KB

To fix the issue, I have converted the line breaks in the logout message to the <br> tag and allowed the <br> tags in the XSS filter to be retained, so that line breaks get displayed in the logout message.

nevergone’s picture

Issue tags: +Needs tests

@mehul.gada

Ok, thanks, but please add test.
Extend Drupal\Tests\redirect_after_logout\Functional\TestBase class and use setRedirectConfig() method.
Example: Drupal\Tests\redirect_after_logout\Functional\SettingsTest class.

Test running: https://www.drupal.org/docs/automated-testing/phpunit-in-drupal/running-...

mehul.gada’s picture

StatusFileSize
new3.87 KB

Hi @nevergone,

I have added test cases to check the message with Line breaks. Please find attached the updated patch containing test cases.

mehul.gada’s picture

StatusFileSize
new4.13 KB

Updated the patch for the PHPUnit test. The Automated testing seems to be failing in general for the given version (8.x-1.x-dev
) of the module (see https://www.drupal.org/pift-ci-job/2446668). One reason seems to be the masquerade module having deprecated code (there is an issue in the queue for the same - https://www.drupal.org/project/masquerade/issues/3288461 but still in review state). I have applied the patch in my local environment and post that the test was passed without any error.

nevergone’s picture

Related issues: +#3303794: Support website with subdirectory
StatusFileSize
new2.6 KB
new3.08 KB

Simplifying the test.

Related issue: #3303794: Support website with subdirectory

nevergone’s picture

Status: Active » Needs review

  • 38be2ed committed on 8.x-1.x
    Issue #3302131 by mehul.gada, nevergone: Logout message line-break
    
nevergone’s picture

Status: Needs review » Fixed

Thanks, committed, pushed!

nevergone’s picture

Issue tags: -Needs tests

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.