Problem/Motivation

There is issue with #field_prefix and #field_suffix of textfield form element. If any textfield which have #field_prefix and #field_suffix property defined in form definition and #field_prefix and #field_prefix have html content then those html will be displayed on screen as plain text. Follow the steps to reproduce:

1. Go to any content type manage field section. (For article content type goto admin/structure/types/manage/article/fields)
2. Add image field if not added, If image field already added then go to image field setting form.
3. See under image field setting form. #field_prefix content <div class="container-inline"> and #field_suffix </div> are displayed on screen.

field_prefix field_suffix issue

Proposed resolution

Edit the form-element.html.twig template and add the raw twig filter to prefix and suffix variable.

Remaining tasks

Write a patch.

User interface changes

None.

API changes

None.

Files: 
CommentFileSizeAuthor
#1 system-field_prefix_suffix_html-2340659-1.patch845 bytesmsankhala
PASSED: [[SimpleTest]]: [PHP 5.4 MySQL] 77,314 pass(es). View
textfield_field_prefix_field_suffix_issue.png36.26 KBmsankhala

Comments

msankhala’s picture

FileSize
845 bytes
PASSED: [[SimpleTest]]: [PHP 5.4 MySQL] 77,314 pass(es). View

Applying raw filter to prefix and suffix variable resolve the issue. Adding patch.

joelpittet’s picture

msankhala’s picture

Status: Active » Needs review
alqahtani’s picture

Status: Needs review » Closed (duplicate)

It's been solved in the linked issue provided by joelpittet on comment #2