Issue #3641565: Stop saving image_captcha.settings during form build

Issue: https://www.drupal.org/project/captcha/issues/3641565

Summary of Changes:

  • Removed config writes ($config->set('image_captcha_fonts_preview_map_cache', ...); $config->save();) during ImageCaptchaSettingsForm::settingsDotSection() form building.
  • Implemented standard Drupal Cache API caching in _image_captcha_get_available_fonts_from_directories() with cache ID image_captcha:available_fonts.
  • Updated CaptchaFontPreviewController and image_captcha_font_preview() to read available fonts from _image_captcha_get_available_fonts_from_directories().
  • Removed deprecated image_captcha_fonts_preview_map_cache sequence from config install and schema definitions.
  • Added post-update hook image_captcha_post_update_remove_fonts_preview_map_cache() to clean up existing active configuration.
  • Added functional test assertion verifying image_captcha.settings remains untouched after loading the settings form.

AI Disclosure: Code, tests, and MR description were drafted with the assistance of an AI tool (Antigravity/LLM), and manually verified and tested.

Edited by Keerthi Kumar

Merge request reports

Loading
Loading