- Issue created by @sc_cojocari
- 🇩🇪Germany Anybody Porta Westfalica
Looks like an AJAX / once issue, I guess.
Could you please provide steps to reproduce this in a vanilla environment? I wasn't able to reproduce this, what ever I tried. Anything special about where the CAPTCHA is placed? Does that happen on any form?
- 🇲🇩Moldova sc_cojocari
I have the same issue on the any webform where image captcha element is attached.
I use docker ENV. - 🇩🇪Germany Anybody Porta Westfalica
1.13 is 2.x-dev so I'm changing versions.
Still I'm not able to reproduce the issue... mhm - 🇲🇩Moldova sc_cojocari
Ok. I have 2 different sites, both of them on Drupal 9
First one is with Drupal 9.5.9, Webform 6.1.5 and Captcha 1.13
Second one is with Drupal 9.5.10, Webform 6.1.5 and Captcha 1.13
I have the same captcha issue on both of them. - Assigned to Grevil
- 🇩🇪Germany Anybody Porta Westfalica
@Grevil: Could you please try to reproduce this and see if there's a once() issue? (missing once for the reload icon)
- 🇩🇪Germany Grevil
I was able to reproduce this! Thanks, @sc_cojocari.
I adjusted the "Steps to reproduce" section.
- 🇩🇪Germany Anybody Porta Westfalica
@Grevil could you please separately try, if it also happens, if just using 2.x, not upgrading from an older version?
I still think it's a JS once() issue with some kind of AJAX for example. - 🇩🇪Germany Grevil
Yep, it is a general 2.x issue. Got nothing to do with the upgrade path!
- Status changed to Postponed
almost 2 years ago 9:34am 4 August 2023 - 🇩🇪Germany Grevil
Not a problem on our side. Webform manually renders the refresh button on their side in "webform/src/Plugin/WebformElement/Captcha.php", line 245 an follows:
// Add image refresh button to captcha form element. // @see image_captcha_after_build_process() if ($form_state->getFormObject() instanceof WebformSubmissionForm) { $is_image_captcha = FALSE; if ($element['#captcha_type'] === 'image_captcha/Image') { $is_image_captcha = TRUE; } elseif ($element['#captcha_type'] === 'default') { $default_challenge = \Drupal::service('config.manager') ->getConfigFactory() ->get('captcha.settings') ->get('default_challenge'); if ($default_challenge === 'image_captcha/Image') { $is_image_captcha = TRUE; } } if ($is_image_captcha && isset($element['#captcha_info']['form_id'])) { $form_id = $element['#captcha_info']['form_id']; $uri = Link::fromTextAndUrl(t('Get new captcha!'), new CoreUrl('image_captcha.refresh', ['form_id' => $form_id], ['attributes' => ['class' => ['reload-captcha']]] ) ); $element['captcha_widgets']['captcha_refresh'] = [ '#theme' => 'image_captcha_refresh', '#captcha_refresh_link' => $uri, '#parents' => array_merge($element['#parents'], ['captcha_widgets']), ]; } }
I'll create an issue with an appropriate MR on their side.
- Status changed to Closed: works as designed
almost 2 years ago 10:21am 4 August 2023 - 🇩🇪Germany Grevil
Ok, this was already fixed in webform through 📌 Remove special image_captcha_refresh handling Fixed . But there is no tagged release yet.
@sc_cojocari please use the webform dev version for the time being.