Views admin summaries are double escaped in some cases

Created on 26 August 2016, almost 9 years ago
Updated 30 December 2023, over 1 year ago

Problem/Motivation

Views admin summaries are double escaped

Steps to reproduce

- create a view
- add a page display
- add a menu item under 'Page settings' and give it a title containing a ' that is long enough to get truncated (> 20 characters)
- save the menu item dialog

Proposed resolution

Don't just cast everything to a string that needs truncation, use PlainTextOutput::renderFromHtml to make sure we don't work with already escaped text when a Markup object is supplied for $string, than let Unicode::truncate do the work instead of doing something Views specific

Remaining tasks

Review

User interface changes

NA

API changes

NA

Data model changes

NA

Release notes snippet

NA

๐Ÿ› Bug report
Status

Needs work

Version

11.0 ๐Ÿ”ฅ

Component
Views UIย  โ†’

Last updated about 13 hours ago

Created by

๐Ÿ‡ฌ๐Ÿ‡งUnited Kingdom joachim

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • ๐Ÿ‡ณ๐Ÿ‡ฑNetherlands Lendude Amsterdam

    Moved to MR, lets see what tests fail now and fix them

  • Merge request !5819Don't double escape View UI summaries โ†’ (Open) created by Lendude
  • Status changed to Needs review over 1 year ago
  • ๐Ÿ‡ณ๐Ÿ‡ฑNetherlands Lendude Amsterdam

    Fixed the tests, did some manual testing, updated the IS

  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia abhijith s

    Tested on Drupal 11.x using MR 5819. The problem is solved after applying this patch

    RTBC +1

  • Status changed to RTBC over 1 year ago
  • ๐Ÿ‡บ๐Ÿ‡ธUnited States smustgrave

    Verified test-only change

    1) Drupal\Tests\views_ui\Functional\ViewEditTest::testOtherOptions
    Behat\Mink\Exception\ExpectationException: The string "one two three four five six seven eight nine ten eleven twelve thirteenโ€ฆ" was not found anywhere in the HTML response of the current page.
    /builds/issue/drupal-2790597/vendor/behat/mink/src/WebAssert.php:794
    /builds/issue/drupal-2790597/vendor/behat/mink/src/WebAssert.php:324
    /builds/issue/drupal-2790597/core/tests/Drupal/Tests/WebAssert.php:540
    /builds/issue/drupal-2790597/core/modules/views_ui/tests/src/Functional/ViewEditTest.php:58
    /builds/issue/drupal-2790597/vendor/phpunit/phpunit/src/Framework/TestResult.php:728
    ERRORS!
    Tests: 4, Assertions: 112, Errors: 1.
    

    Fixed up the issue summary to follow the standard template (important parts were already there).

    Tested manually and MR does appear to address the issue.

  • Status changed to Needs work over 1 year ago
  • ๐Ÿ‡บ๐Ÿ‡ธUnited States xjm
  • ๐Ÿ‡ณ๐Ÿ‡ฟNew Zealand quietone

    I'm triaging RTBC issues โ†’ . I read the IS, the MR and the comments. I didn't find any unanswered questions.

    I did leave some suggestions for comments in the MR. I am setting back to needs work for someone to check those.

    Adding credit for triage in #9.

Production build 0.71.5 2024