Invalid Mapping Definition in upload_validators Config Schema

Created on 27 September 2024, 3 months ago

Problem/Motivation

After upgrading from Drupal core 10.2.x to 10.3.x, attempting to install certain modules (e.g., config) or syncing configuration results in an error:

LogicException: The mapping definition at `entity_browser.browser.image_browser.widgets.44d52e51-9627-43b5-a637-3b0462041d1c.settings:upload_validators` is invalid: its `type` key contains a string. It must be an array. in Drupal\Core\Config\Schema\Mapping->__construct()

This error occurs due to changes in Drupal 10.3's configuration validation. The upload_validators property of the entity_browser config object, which was previously defined as a mapping, now needs to be defined as a sequence in the config schema. This is because upload_validators is a dynamic list of functions with varying arguments, and the current schema definition doesn't support this flexibility.

Steps to reproduce

  • Upgrade Drupal core to version 10.3.x.
  • Attempt to install the config module or similar modules that rely on entity_browser.
  • Observe the error during the installation or configuration sync.

Proposed resolution

Modify the configuration schema definition for upload_validators to use a sequence instead of a mapping. This allows for a dynamic list of function names and arguments, as required by the upload_validators configuration.

🐛 Bug report
Status

Active

Version

5.3

Component

Code

Created by

🇨🇦Canada smulvih2 Canada 🍁

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024