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.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

msankhala’s picture

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