Problem/Motivation

If a reCAPTCHA is assigned to a form and the fallback logic comes in action it is cached and after the recaptcha configuration the Math captcha is still shown where the reCaptcha should be shown. D8 core caches everything and causes this issue.

Proposed resolution

Add addCacheableDependency() to both reCAPTCHA and Math captcha form, see https://www.drupal.org/developing/api/8/render/arrays/cacheability

Add cache logic to D8 and backport code changes just to stay in sync.

Remaining tasks

None

User interface changes

None

API changes

None

Comments

hass’s picture

Issue summary: View changes

  • hass committed 9ea0843 on 8.x-2.x
    Issue #2486041 by hass: addCacheableDependency to Math captcha
    
hass’s picture

Title: Math captcha fallback form caching issue » addCacheableDependency to Math captcha

  • hass committed bda313f on 7.x-2.x
    Issue #2486041 by hass: D8 backport of Math captcha fallback code...
hass’s picture

Status: Active » Fixed

  • hass committed 2341921 on 6.x-2.x
    Issue #2486041 by hass: D8 backport of Math captcha fallback code...
hass’s picture

Issue summary: View changes
hass’s picture

Title: addCacheableDependency to Math captcha » addCacheableDependency to both reCAPTCHA and Math captcha form

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.