Hi

I have come across an issue where the [current-page:query:?] token is not working as I would expect. If you set the default value of a Webform field as [current-page:query:foo] and in the url you have www.mydomain.com/mywebform?foo=bar, then the Webform field correctly gets populated with bar. But if you don't have the ?foo= in the url and navigate to www.mydomain.com/mywebform, then the field is incorrectly populated with the text [current-page:query:foo] instead of being blank. I have done some testing in simplytest.me (only installing Webform and Token) and it functions correctly up to and including Webform 8.x.5.0-beta21. All versions after then displays this issue.

Any ideas?

F

CommentFileSizeAuthor
#6 2996555-6.patch655 bytesjrockowitz
#4 2996555-4.patch1.22 KBjrockowitz

Comments

frankdesign created an issue. See original summary.

jrockowitz’s picture

Status: Active » Closed (works as designed)

You must specify when tokens should be cleared by adding the :clear suffix.

You should change [current-page:query:foo] to [current-page:query:foo:clear]

frankdesign’s picture

Thanks @jrockowitz. I tried that but now I get '[current-page:query:foo:clear]' in the Webform field no matter what I have in the URL. What am I missing?

F

jrockowitz’s picture

Status: Closed (works as designed) » Needs review
StatusFileSize
new1.22 KB

I did not realize the :clear suffix was only being applied to [webform*] tokens.

The attached patch fixes this issue.

Status: Needs review » Needs work

The last submitted patch, 4: 2996555-4.patch, failed testing. View results

jrockowitz’s picture

Status: Needs work » Needs review
StatusFileSize
new655 bytes
jrockowitz’s picture

Status: Needs review » Fixed

I committed the patch. Please download the latest dev release to review.

frankdesign’s picture

Sorry, only getting back at this now. The :clear is not working on the latest dev version but it's working perfectly when I apply the patch to rc18.

Thanks a mil

F

  • jrockowitz committed 698cd11 on 8.x-5.x
    Issue #2996555 by jrockowitz: [current-page:query:?] token not working...
jrockowitz’s picture

Yep, I forgot to push the local commit,

Status: Fixed » Closed (fixed)

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