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
configmodule or similar modules that rely onentity_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.
| Comment | File | Size | Author |
|---|---|---|---|
| #2 | wxt-upload-validators-3477356-2.patch | 691 bytes | smulvih2 |
Comments
Comment #2
smulvih2Patch to fix the issue for reference.
Comment #4
smulvih2This has been merged with 5.3.x and confirmed working.