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.
Reproduce:
Create a modal link within the body field of a node on a vanilla 8.0.1 standard profile installation.
<a class="use-ajax" data-dialog-type="modal" href="/node/2">Show me a modal</a>
View the node using Bartik
Expecting:
The node title displayed in the modal title area.
Actual:
The modal title displays encoded markup.
Comment | File | Size | Author |
---|---|---|---|
#9 | 2637550-8.patch | 1.21 KB | joelpittet |
#3 | strip-tags-from-modal-title-2637550-3.patch | 981 bytes | rattusrattus |
#2 | Screen+Shot+2015-12-18+at+11.03.49.png | 98.54 KB | rattusrattus |
Comments
Comment #2
rattusrattus CreditAttribution: rattusrattus commentedAdding screenshot.
Comment #3
rattusrattus CreditAttribution: rattusrattus commentedPatch to strip any markup from content tile before passing to OpenModalDialogCommand.
Comment #4
rattusrattus CreditAttribution: rattusrattus commentedComment #5
rattusrattus CreditAttribution: rattusrattus at CTI Digital commentedComment #6
cilefen CreditAttribution: cilefen commentedComment #9
joelpittetThis likely needs some tests but I'm not sure. I think the patch is correct, I've seen some other modal related issues that are using
PlainTextOutput::renderFromHtml
, so I've swapped that out. Do you think that is ok @ratface? Also do you think you'd be up for writing an integration test for this?Comment #10
joelpittetThis looks to be solved by #2207247: Dialog titles double escaped for views handlers and delete forms