Problem/Motivation
The webform module gives some problems, especially if the user is anonymous.
Steps to reproduce
In a webform field use [current-user:email|current-page:query:url_param]. If is anonymous, it deletes the whole token.
| Comment | File | Size | Author |
|---|---|---|---|
| #2 | 3406685-support-for-webform.patch | 3.88 KB | jmaties |
Issue fork token_or-3406685
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #2
jmaties commentedComment #3
jmaties commentedComment #4
jmaties commentedComment #5
jmaties commentedComment #6
jmaties commentedComment #7
socialnicheguru commentedComment #8
nikolay shapovalov commentedThanks for patch Javier, can you please convert it to MR?
To have lint check for your changes.
Comment #10
pianomansam commented@jmaties thanks for your work on this. It looks like this is still in "Needs work" but I wanted to give some quick feedback.
First, it looks like you have duplicated the entire
replacemethod. It would be great if this was more surgical, only making the changes necessary for this functionality to work, and then handing it off to the parent. The reason for this is that the underlyingreplacemethod inWebformTokenManagercould change at any time. If/when it does, those changes won't be reflected in our version. Thus increasing maintenance and the chance something could break.Second, to be accepted, we'll need tests added to your MR. Initially, we'll need tests that fail and demonstrate the issue. Then we'll need passing tests that demonstrate it is resolved.
Comment #11
jmaties commentedThe problem occurs not only with the user annonymous, but also with any parameter.
I tried [current-page:query:param1|current-page:query:param2] and if the first parameter is false it fails.
Comment #12
jmaties commentedI forgot it was a submodule :)
Comment #13
jmaties commentedComment #14
pianomansam commentedWhile I see tests for the submodule, it doesn't look like they are being run by the continuous integration.
Comment #15
jmaties commentedI don't know why this happens...
Comment #16
pianomansam commented@jmaties While I'm trying to get the testing rig working with the submodule, it looks like
TokenOrWebformFunctionalTestBaseis throwing a deprecation error in Drupal 9:Comment #17
jmaties commented@pianomansam thank's, done!!
Comment #19
pianomansam commentedI got tests to work, so I expanded them to make sure they handled both current-user and current-page tokens. Sure enough, they caught an issue with current-user tokens. That is now resolved and I'm content with the amount of test coverage, so I'm merging this into dev.