Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
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
Comment #1
hass CreditAttribution: hass commentedComment #3
hass CreditAttribution: hass commentedComment #5
hass CreditAttribution: hass commentedComment #7
hass CreditAttribution: hass commentedComment #8
hass CreditAttribution: hass commented