Account created on 19 February 2010, almost 15 years ago
#

Recent comments

🇳🇱Netherlands Gerben Spil

I wrote a quick patch that will put the text in a template file. This way, you can at least override the original English version and add a translation that matches the original English version.

🇳🇱Netherlands Gerben Spil

Not sure if the following code is valid so I do not add a patch here, but it works in my project.


public function validateCaptchaToken(&$form, FormStateInterface &$form_state) {
    $triggering_element = $form_state->getTriggeringElement();
    if ($triggering_element['#submit'][0] == 'file_managed_file_submit') {
      return;
    }

🇳🇱Netherlands Gerben Spil

We are having the same issue and I have found the cause, but not yet the solution. In our case we have a node add form that anonymous users can submit. On this form we have recaptcha v3. There is also a file field, where the user can upload an image. This file field is the culprit. The upload is handled with AJAX and this triggers the validation of the form. But the token is not generated untill you use the submit button of the form. So when the file uploads there is no token in the form and the validation fails.

Drupal version: 9.5.3
Module version: 1.0-beta7

Steps to reproduce:

- a form without AJAX handling, for example a node add form
- a field with a file upload
- upload the file
- press submit button

Production build 0.71.5 2024