I am facing this issue post upgrading my Drupal site to Drupal 10, the link below captcha box "Reload Captcha" not visible which was visible and working in Drupal 9..I have used 2.0.5 Drupal 10 compatible version, not able to see this link.. Please check attached image for the same..

Comments

Tushar1 created an issue. See original summary.

gorkde’s picture

Same for me on Drupal 9.45 no refresh button

jordik’s picture

Having the same issue. The Reload button gets loaded in the config form under example, but is missing on any other form - the image_captcha_refresh.js is not loaded.

jordik’s picture

Status: Active » Needs review
StatusFileSize
new1.17 KB

After some investigation I found the source of error (at least in my case).
When setting up Captcha to appear on a form in Captcha points, the challenge type was set to "Default".
Although the default type was set to "Image" in the global Captcha settings, this was never checked.
Since the function imageCaptchaAfterBuildProcess explicitly checks for "image_captcha/Image" by getting "default" it skips the rendering of the Reload button.

A quick and dirty solution can be to set the challenge type to "Image" manually for every form/captcha point.
A more elegant and robust way is in the patch attached - enabling the check of the global default.

Status: Needs review » Needs work
jordik’s picture

The test did not fail because of the patch - it is apparently a test problem.
Patches #3403329: Post Drupal 10 Image captcha issue and #3407854: Switch over to GitLab CI fail after being green with the same error.

jordik’s picture

Seems to be fixed in captcha 2.0.7. Will need the patch from #3489166: Image captcha reload produces a JSON error as the new version produces a JSON error. With the patch the issue is fixed. Closing this one.

jordik’s picture

Status: Needs work » Closed (outdated)