- ๐ง๐ชBelgium gilles_webstanz
Hello,
I think we can close this issue because when you update to the last version webform & simple google recaptcha it works fine.
Have a nice day.
- ๐ฎ๐ณIndia mohit_aghera Rajkot
I'm using patch #3 in webform 6.1.4
It works fine.
Attaching patch with more restrictions as I noticed following errors while indexing the content.
TypeError: array_keys(): Argument #1 ($array) must be of type array, null given in array_keys() (line 142
So doing extra check to ensure that `$pages` is array will not trigger the error.
Keeping in needs work until we have consensus around whether we need to close it or keep it active. - ๐ต๐ฑPoland sandboxpl Poland ๐ต๐ฑ
when testing this we can see that recaptcha logic is attached to the last page of wizard as expected, yet when webform has ajax enabled it indeed has a problem. On the last page of wizard, when we have previous/next buttons available, the "previous" one does not work anymore, this is probably caused by following checks:
https://git.drupalcode.org/project/simple_recaptcha/-/blob/8.x-1.x/js/si...
https://git.drupalcode.org/project/simple_recaptcha/-/blob/8.x-1.x/js/si...
Since this check will pass for both buttons it will break the ajax on previous button, I think we need to try to validate if element triggering ajax is really a submit button , since there is buttons.js which tries to mark exactly one file with .simple-recaptcha-submit class, maybe it could be reused in ajax logic as well.Then this patch also raises a discussion if the recaptcha logic should be attached to first or last step of wizard ( imo first is better, since it can prevent creation of empty submissions by bots ), maybe to solve this we could extend handler settings and allow to choose if recaptcha should be added for first or last step on a webform basis..
- First commit to issue fork.
- Merge request !24Add support to multistep webforms and fix previous button on ajax webforms โ (Open) created by Unnamed author
- ๐ต๐นPortugal fmfpereira
Based on the feedback of #11 I've picked up on the patch from #10 and
- Made sure that submit element that triggers the captcha contains the class .simple-recaptcha-submit
- Add a configuration and logic to the webform handler to define if the submit element on the multistep form is triggered on the first or last step
Changes were added to the issue fork.
Patch attached if needed.
- ๐ต๐นPortugal fmfpereira
Adding a new version of the patch, since the last one missed an array validation of the first step.
Issue fork branch is updated.