The move to "proper tokens" in Webform 4.0 is fantastic and has really helped us get more out of e.g. webform emails. But I've found an ambiguity in the documentation for the "Webform submission values" tokens.
A client was trying to use the tokens of the format [submission:values:?:nolabel] and couldn't get them to work based on the documentation ("Replace the "?" with the "Field Key"). Neither could we.
It was only through looking at the code in webform.tokens.inc that we realised that you actually have to replace "?" with the field key of all containing fieldset parents, plus the element: so
[submission:values:your_details:first_name:nolabel]
instead of just
[submission:values:first_name:nolabel]
I appreciate why that's the case, but I don't think it's currently clear. So I'll attach a patch in my first comment, to just disambiguate this documentation. I don't want to start bikeshedding wording, but I think a small change would really help non-programmer users.
Comment | File | Size | Author |
---|---|---|---|
#2 | webform-documentation-tweak-1797670-2.patch | 1.18 KB | firfin |
#1 | webform-token-values-documentation-tweak-179670-1.patch | 779 bytes | jp.stacey |
Comments
Comment #1
jp.stacey CreditAttribution: jp.stacey commentedHere's the patch. It's quite small so should be straightforward to review!
Comment #2
firfin CreditAttribution: firfin commentedI totally agree with jp stacey. However the patch in #1 didn't apply for me :
fatal: git diff header lacks filename information when removing 1 leading pathname components (line 5)
Re-rolled. Also made some small textual changes. And updated README.txt to point users toward the documentation.
Comment #3
quicksketchThanks! I agree it needs help. I've changed the string to be this:
Comment #4
firfin CreditAttribution: firfin commentedThanks Quicksketch!
Comment #5
jp.stacey CreditAttribution: jp.stacey commentedYes, sorry, I missed quicksketch's reply last week. That'll do nicely.