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.
How to reproduce:
- Create a field for user entity
- Create a webform with textfield element
- Set textfield default value to token representing created field for user entity (e.g.
[webform-authenticated-user:field_user_name]
) - Render the webform. Default value of textfield is printed as string (eg.
[webform-authenticated-user:field_user_name]
) - Once the value is inserted, token is properly replaced
This seems to be related to https://www.drupal.org/project/webform/issues/2925408, which is working fine.
Comment | File | Size | Author |
---|---|---|---|
#2 | 2932080-2.patch | 742 bytes | jrockowitz |
|
Comments
Comment #2
jrockowitz CreditAttribution: jrockowitz as a volunteer and at The Big Blue House commentedComment #3
milos.kroulik CreditAttribution: milos.kroulik commentedIt works fine for me. Thanks a lot!
Comment #5
jrockowitz CreditAttribution: jrockowitz as a volunteer and at The Big Blue House commentedComment #7
BartNijs CreditAttribution: BartNijs commentedThis patch seems to be included in version 5.0-rc12, but empty tokens still show up text for me ([current-page:query:act])
Comment #8
jrockowitz CreditAttribution: jrockowitz as a volunteer and at The Big Blue House commentedOnly user related tokens are replace with empty strings.
BTW, webform elements can be prepopulated via query string parameters.
Comment #9
dnlt CreditAttribution: dnlt as a volunteer commentedQuery string prepopulation puts token string ([current-page:query:act] in the example) for me, when parameter is not provided at the query string.
Maybe webform prepopulates via token?
Comment #10
jrockowitz CreditAttribution: jrockowitz as a volunteer and at The Big Blue House commentedThis should be fixed in the latest release.
Try
[current-page:query:act:clear]