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.

CommentFileSizeAuthor
#2 wxt-upload-validators-3477356-2.patch691 bytessmulvih2

Comments

smulvih2 created an issue. See original summary.

smulvih2’s picture

StatusFileSize
new691 bytes

Patch to fix the issue for reference.

  • smulvih2 committed aa69b113 on 5.3.x
    Issue #3477356 by smulvih2: Invalid Mapping Definition in...
smulvih2’s picture

Status: Active » Fixed

This has been merged with 5.3.x and confirmed working.

Status: Fixed » Closed (fixed)

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