Config schema is incorrect

Created on 18 March 2024, 3 months ago
Updated 24 June 2024, 5 days ago

Problem/Motivation

When importing a form_mode_control config change I get the following error:

The configuration property _core.default_config_hash doesn't exist.

Our config doesn't have _core.default_config_hash yet and core is trying to set it automatically. The problem is that in Drupal\Core\Config\Schema\ArrayElement::get(), line 64, there's a check to make sure default_config_hash is an instance of TypedConfigInterface. With this module's config present it's not, it's an instance of \Drupal\Core\TypedData\Plugin\DataType\StringData. This happens because config/schema/form_mode_control.settings.yml is telling Drupal that form_mode_control.settings is an sequence of only strings, but since Drupal adds a few default properties we can't make this assumption. Config objects should be set to type: config_object.

Proposed resolution

Nest the permissions under a parent key, e.g. permissions. A temporary quickfix could be to revert πŸ› Add schema for form_mode_control.settings Fixed .

Remaining tasks

Update the schema, any places using the settings config and any existing config data to match the new structure.

πŸ› Bug report
Status

Active

Version

2.0

Component

Miscellaneous

Created by

πŸ‡§πŸ‡ͺBelgium DieterHolvoet Brussels

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

Comments & Activities

  • Issue created by @DieterHolvoet
  • πŸ‡§πŸ‡ͺBelgium DieterHolvoet Brussels
  • πŸ‡§πŸ‡ͺBelgium DieterHolvoet Brussels
  • πŸ‡§πŸ‡ͺBelgium DieterHolvoet Brussels
  • πŸ‡ͺπŸ‡ΈSpain marthinal

    I have this error when updating Drupal core:

    >  [notice] Update started: system_post_update_add_langcode_to_all_translatable_config
    >  [notice] Processed 50 items of 1278.
    >  [notice] Processed 100 items of 1278.
    >  [notice] Processed 150 items of 1278.
    >  [notice] Processed 200 items of 1278.
    >  [notice] Processed 250 items of 1278.
    >  [notice] Processed 300 items of 1278.
    >  [notice] Processed 350 items of 1278.
    >  [notice] Processed 400 items of 1278.
    >  [notice] Processed 450 items of 1278.
    >  [notice] Processed 500 items of 1278.
    >  [notice] Processed 550 items of 1278.
    >  [notice] Processed 600 items of 1278.
    >  [notice] Processed 650 items of 1278.
    >  [notice] Processed 700 items of 1278.
    >  [notice] Processed 750 items of 1278.
    >  [error]  AssertionError: assert($typed_config instanceof Mapping) in assert() (line 264 of /var/www/html/docroot/core/modules/system/system.post_update.php) #0 /var/www/html/docroot/core/modules/system/system.post_update.php(264): assert(false, 'assert($typed_c...')
    

    I updated the schema + implemented hook_update_N

Production build 0.69.0 2024