How to reproduce:

  1. Create a field for user entity
  2. Create a webform with textfield element
  3. Set textfield default value to token representing created field for user entity (e.g. [webform-authenticated-user:field_user_name])
  4. Render the webform. Default value of textfield is printed as string (eg. [webform-authenticated-user:field_user_name])
  5. 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.

CommentFileSizeAuthor
#2 2932080-2.patch742 bytesjrockowitz
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

milos.kroulik created an issue. See original summary.

jrockowitz’s picture

Status: Active » Needs review
FileSize
742 bytes
milos.kroulik’s picture

Status: Needs review » Reviewed & tested by the community

It works fine for me. Thanks a lot!

  • jrockowitz committed 211819a on 8.x-5.x
    Issue #2932080 by jrockowitz: Tokens represeting empty fields aren't...
jrockowitz’s picture

Status: Reviewed & tested by the community » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.

BartNijs’s picture

This patch seems to be included in version 5.0-rc12, but empty tokens still show up text for me ([current-page:query:act])

jrockowitz’s picture

Only user related tokens are replace with empty strings.

BTW, webform elements can be prepopulated via query string parameters.

dnlt’s picture

Query 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?

jrockowitz’s picture

This should be fixed in the latest release.

Try [current-page:query:act:clear]