I am getting the same issue when loading the normal webform page with the setting "Use Ajax" turned on in the webform settings.
- ๐บ๐ธUnited States greatmatter
Thank you, @gobind-singh - as soon as reCAPTCHA 3.2 is released (or whatever implements the fixes in that issue), we'll port them to this module.
- ๐จ๐ญSwitzerland stefanos.petrakis@gmail.com Biel, Switzerland
stefanos.petrakis โ made their first commit to this issueโs fork.
- ๐จ๐ญSwitzerland stefanos.petrakis@gmail.com Biel, Switzerland
stefanos.petrakis โ changed the visibility of the branch 3330710-PoC-render-when-empty to hidden.
- ๐จ๐ญSwitzerland stefanos.petrakis@gmail.com Biel, Switzerland
stefanos.petrakis โ changed the visibility of the branch 3330710-PoC-render-when-empty to active.
- Merge request !3Resolve #3330710 "Poc render when empty" โ (Merged) created by stefanos.petrakis@gmail.com
- Status changed to Needs review
10 months ago 4:06pm 22 February 2024 - ๐จ๐ญSwitzerland stefanos.petrakis@gmail.com Biel, Switzerland
I got a small PoC working that may solve the issue(s) reported here.
For the time, Merge request !3 is available for testing if somebody would have the curiosity/time.
I will move this to Needs Review to get some eyes moving, the maintainers can decide to move this back to Postponed if they feel that this issue should follow the outcomes of ๐ Ajax support / Use behaviors Fixed
-
greatmatter โ
committed c2afc759 on 1.0.x authored by
stefanos.petrakis@gmail.com โ
Resolve #3330710 "Poc render when empty"
-
greatmatter โ
committed c2afc759 on 1.0.x authored by
stefanos.petrakis@gmail.com โ
- ๐บ๐ธUnited States greatmatter
Thank you, Stefanos! I've merged it, and added it to a dev release for testing. Once it's RTBC, I'll make it a supported release.
- Status changed to Needs work
10 months ago 3:32pm 7 March 2024 - ๐บ๐ธUnited States greatmatter
This patch doesn't work when AJAX is not enabled, unfortunately, including other non-webform forms.
- ๐จ๐ญSwitzerland stefanos.petrakis@gmail.com Biel, Switzerland
All right, let's work on this more then. Is there more to know apart from disabling AJAX?
- ๐บ๐ธUnited States greatmatter
Unfortunately, I'm not sure--my own use cases don't use AJAX, so my testing is a bit limited.
- ๐จ๐ญSwitzerland stefanos.petrakis@gmail.com Biel, Switzerland
At least some steps to reproduce?
I tried with a simple webform without AJAX, got a console warning, but, the submission worked.Alternatively, could you try to replace the following in
turnstile.libraries.yml
:- core/jquery
to
- core/drupal.ajax
If that solves the problem you are having (related to the console warnings), then I have an idea how to update the PR.
- ๐จ๐ฟCzech Republic parisek
I have similar issue and this MR fixes it for me (I'm using it exclusively for webform with AJAX enabled), thank you
greatmatter: Could you provide more information where it's not working (exact example) or steps to reproduce?
- ๐บ๐ธUnited States greatmatter
@parisek I was just trying to troubleshoot the other issue (we don't utilize it this way). I'll probably have to refactor the module, but since so much of it was taken from the reCAPTCHA module, I'll hold off until it supports ^11.
-
greatmatter โ
committed c2afc759 on Fix-hl-Parameter authored by
stefanos.petrakis@gmail.com โ
Resolve #3330710 "Poc render when empty"
-
greatmatter โ
committed c2afc759 on Fix-hl-Parameter authored by
stefanos.petrakis@gmail.com โ
- First commit to issue fork.
- Merge request !5Convert the Turnstile library to a Drupal library so that it can be loaded via AJAX โ (Open) created by clayfreeman
- Status changed to Needs review
3 months ago 5:40pm 6 September 2024 - ๐บ๐ธUnited States clayfreeman Paragould, AR
I believe the root of the problem is that the Turnstile library is being attached directly to the HTML head, which doesn't exist for AJAX responses. Instead, I've converted the Turnstile library to a Drupal library and added it as a dependency of the element. This solves the problem for my dynamically-loaded form.
- ๐บ๐ธUnited States greatmatter
Thank you for your work on this--will test & review!
- ๐บ๐ธUnited States glynster
That said the latest release does not apply any more.
- ๐บ๐ธUnited States greatmatter
Apologies; the latest release should have all of these patches.
Automatically closed - issue fixed for 2 weeks with no activity.
- ๐บ๐ธUnited States JaceRider
Of the two merge requests, only one was merged. An issue still remains when the entire form is loaded via ajax as the #attached => html_head does not get handled via ajax so the necessary javascript is never loaded.
See this merge request: https://git.drupalcode.org/project/turnstile/-/merge_requests/5/diffs?co...
The attached patch solves the issue and is a slightly modified from the above so that it applies cleanly to the current stable branch.
- ๐บ๐ธUnited States JaceRider
Here is the correct patch. The above was from the original merge request.