Problem/Motivation
If a user flags or unflags content, Drupal displays a status message. If no "(un)flagged message" is set (which is possible, because it's not required in settings form), this status message is empty (box with no content).
Steps to reproduce:
- Go to flags settings: /admin/structure/flags
- Make sure "Flagged message" and/or "Unflagged message" is not set.
- Flag content
Proposed resolution
Don't show status message if text is empty.
| Comment | File | Size | Author |
|---|---|---|---|
| #6 | 3157753-6.patch | 3.43 KB | idebr |
| #6 | interdiff-4-6.txt | 2.71 KB | idebr |
Comments
Comment #2
pminfPatch to just check if message text is empty before adding it.
Comment #3
pminfComment #4
pminfLast patch had wrong paths. Fixed it.
Comment #5
idebr commentedThe same symptom occurs in the Drupal.AjaxCommands.actionLinkFlash:
The script should not generate a DOM-element here if the
response.messageis an empty string.Comment #6
idebr commentedAttached patch prevents rendering of an empty message in both the js and nojs scenario.
Comment #7
eworwa commentedHi, I applied the patch from #6 and can confirm that fixes the issue.
Drupal 8.9.13
Flag 8.x-4.0-beta2
Link type: Normal link
Comment #8
seanb#6 works for me!
Comment #10
berdirCommitted.