Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Problem/Motivation
When showing the summary, we can get text that can be only be tags with no context. If we have useful information, we might lose it if we do not display it.
Proposed resolution
If there is if the result of strip_tags() is empty, we'd fall back to a escaped version of the HTML tags, so it should something like "
Remaining tasksUser interface changes
API changes
Data model changes
Comment | File | Size | Author |
---|---|---|---|
#11 | paragraphs_3008364_11.patch | 2.61 KB | miro_dietiker |
| |||
#10 | interdiff-3008364-7-10.txt | 656 bytes | johnchque |
#10 | show_raw_summary-3008364-10.patch | 2.42 KB | johnchque |
| |||
#7 | interdiff-3008364-4-7.txt | 426 bytes | johnchque |
#7 | show_raw_summary-3008364-7.patch | 2.22 KB | johnchque |
|
Comments
Comment #2
johnchqueThis should work, working on tests now. :)
Comment #4
johnchqueOk, adding tests, not sure if HEAD is failing. Seems demo is used on some tests. We should remove that.
Comment #6
miro_dietikerUse methods like htmlspecialchars, not selfcoded replaces.
Comment #7
johnchqueThat's true. Thanks.
Comment #8
johnchqueFails should be fixed in #3008584: Remove demo from tests :)
Comment #9
miro_dietikerSorry, i think this should go into the getTextSummary() method and the raw text also need to be truncated like usual for text fields.
Currently there wouldn't be any summary from such a text field as soon as a behavior setting is applied, making the summary as unclear as before. It's really a fallback for an empty text field.
We will work on displaying behavior summaries differently soon and keep this separated from the text summary.
Comment #10
johnchqueRight, updating. :)
Comment #11
miro_dietikerDid some rewrite as i don't want to drop the parent strip_tags to protect from bad content of other summary components like labels...
Ready?
Comment #13
miro_dietikerAwesome, committed.