visit page:/admin/config/people/captcha/image_captcha, got following errors:

Drupal\Core\Config\UnsupportedDataTypeConfigException: Invalid data type for config element image_captcha.settings:image_captcha_fonts_preview_map_cache.3438abc85ac58eaab01cd741b1c3f9bb5dd3b9be3c079b1a7851884135608b2f in Drupal\Core\Config\StorableConfigBase->validateValue

remove following code fixed:

// Font related stuff.
//$form['image_captcha_font_settings'] = $this->settingsDotSection();

Comments

g089h515r806 created an issue. See original summary.

Anybody’s picture

Status: Active » Closed (duplicate)
Parent issue: » #2501699: Fix Image CAPTCHA settings form
solerous’s picture

I tried this fix and it will load the settings now, but the font section is missing. Also, when I try to save any settings it throws and error:

Warning: array_filter() expects parameter 1 to be array, null given in Drupal\image_captcha\Form\ImageCaptchaSettingsForm->validateForm() (line 253 of modules/contrib/captcha/image_captcha/src/Form/ImageCaptchaSettingsForm.php).
Warning: count(): Parameter must be an array or an object that implements Countable in Drupal\image_captcha\Form\ImageCaptchaSettingsForm->validateForm() (line 254 of modules/contrib/captcha/image_captcha/src/Form/ImageCaptchaSettingsForm.php).
Warning: Invalid argument supplied for foreach() in _image_captcha_check_fonts() (line 62 of modules/contrib/captcha/image_captcha/image_captcha.module).
You need to select at least one font.

I'm using Drupal 8.6.7 and PHP 7.2.8