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
We have a site with a "name" field that often contains multiple names with an ampersand -- for example, "Doe, John & Mary". When using the [current_user:field_name] token, the ampersand gets HTML-encoded to &.
Steps to reproduce
Create a user field.
Put an & in it.
Use the token for the field as the default value of a webform field.
Go to the form and see "Doe, John & Mary" in the form element.
Proposed resolution
Un-escape the values when used as a default field.
Remaining tasks
Write patch.
Comments
Comment #2
freelockComment #3
jrockowitz CreditAttribution: jrockowitz as a volunteer and at The Big Blue House commentedYou can use the
:htmldecode
or :striptags
suffixes.[current_user:field_name:htmldecode]
@see /admin/help/token
Comment #4
jrockowitz CreditAttribution: jrockowitz as a volunteer and at The Big Blue House commentedComment #5
freelockAh, cool, thanks!