Problem/Motivation

the :clear functionality is undocumented, without it tokens are not getting replaced/substituted when the element has no value

Steps to reproduce

add a field to a webform of type managed_file , allow N values, optional field, if no file is uploaded the token shows up in the submission email, we do not want to render the token in the submission email so we want to substitute the null value with '' empty string instead of the token it'self

Proposed resolution

Add a note about how this functionality works in the README.md

Remaining tasks

Add a patch for the README.md file
review the patch, not sure if this is an appropriate solution or if it will cause regressions.

User interface changes

N/A

API changes

no

Data model changes

N/A

Comments

joseph.olstad created an issue. See original summary.

joseph.olstad’s picture

StatusFileSize
new414 bytes

here is the patch

jrockowitz’s picture

Please append :clear to the token (i.e. [webform_submission:values:file:clear])

joseph.olstad’s picture

Category: Bug report » Support request

ah ok, good to know, so this patch isn't necessary then?

joseph.olstad’s picture

Status: Needs review » Fixed

ok marking this as fixed unless otherwise , I will test :clear

joseph.olstad’s picture

Title: Substitute token with empty value if value is null » Undocumented :clear functionality - Substitute token with empty value if value is null
Component: Code » Documentation
Assigned: joseph.olstad » Unassigned
Issue summary: View changes
Status: Fixed » Needs review
jrockowitz’s picture

StatusFileSize
new166.87 KB

This feature is documented under the Token help/description.

jrockowitz’s picture

Status: Needs review » Closed (works as designed)
joseph.olstad’s picture

ok thanks for the heads up, I didn't see a README.txt but perhaps I didn't look hard enough, I saw the README.md and it wasn't there. So it looks like you put the instructions in code. With that said, great work! Thanks for the support!