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
The form element prefix is not filtered correctly. This results in html tags being printed in the node form page.
1) Use Article content type from the standard profile Drupal 8 installation;
2) Open admin/structure/types/manage/article/fields/node.article.field_image;
3) Check the field Maximum image resolution (See the screenshot from the attachment);
Proposed resolution
None yet
Remaining tasks
None yet
Comment | File | Size | Author |
---|---|---|---|
Screenshot 2014-11-08 10.14.08.png | 142.43 KB | LOBsTerr |
Comments
Comment #1
batigolixComment #2
LOBsTerr CreditAttribution: LOBsTerr commentedI tried to debug it. In the template we have pure html in the variable and then this converted by twig.
Obviously, we can use something like this here: \core\modules\system\templates\form-element.html.twig
{{ prefix | raw }}, because in this case we can pass JS code. So, it looks the variables should be properly filtered.
Comment #3
batigolixThis seems related to #2324371: Fix common HTML escaped render #key values due to Twig autoescape
Comment #4
batigolixActually we were working with a outdated Drupal 8 version. Problem has been fixed already.