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 #3359220: Add schema for form_mode_control.settings.

Remaining tasks

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

CommentFileSizeAuthor
#5 3431354-5.patch1.47 KBmarthinal
Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

DieterHolvoet created an issue. See original summary.

dieterholvoet’s picture

dieterholvoet’s picture

Issue summary: View changes
dieterholvoet’s picture

Priority: Normal » Major
marthinal’s picture

StatusFileSize
new1.47 KB

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

balagan’s picture

Confirming that patch in #5 solves that problem, but probably that should be a separate issue.

pianomansam’s picture

Status: Active » Needs review

Patch in #5 fixes this issue for me as well.

  • mandclu committed f9ae34bb on 8.x-2.x
    Issue #3431354 by marthinal: Config schema is incorrect
    
mandclu’s picture

Status: Needs review » Fixed

I merged the patch in #5, but not 100% clear if that addresses the original issue here. The patch does resolve a fatal error when updating to Drupal 10.3, so wanted to make a new release with this fix. Feel free to reopen this issue if more work is needed.

dieterholvoet’s picture

Status: Fixed » Needs work

The update hook in #5 does not work at all, there was no sequence key in the previous config schema. I'll update the patch, hopefully this hasn't been released yet.

dieterholvoet’s picture

Looks like it has been released. I'll add a new update hook instead of fixing the existing one.

dieterholvoet’s picture

The configuration form also hasn't been updated to work with the new config format. Kind of a shame that this has been released without proper testing.

dieterholvoet’s picture

Status: Needs work » Needs review

balagan’s picture

Status: Needs review » Fixed

This is already merged in 2.4.

dieterholvoet’s picture

Status: Fixed » Needs review

@balaganb you didn't read my comment in #10, this issue is not actually fixed.

dieterholvoet’s picture

@mandclu would you mind having a look at this? The config form is still broken in the current release.

eduardo morales alberti’s picture

Status: Needs review » Reviewed & tested by the community

Installing config_inspector we have several errors related to the config from form_mode_control.
Error 'use The form mode default linked to block_content entity( banner_bar )' is not a supported key....
The Mr solves the issue.

eduardo morales alberti’s picture

Any news? The last release was one year ago

defcon0’s picture

Issues here, as well :(

defcon0’s picture

OK, we've had additional problems when opening the user overview page. Here FormModePermission::roleToFormMode() ran and tried to store the config into the old, wrong schema. This was missing in the MR #13 I guess.

I opened a new MR #16

jaydarnell’s picture

Edit: Disregard, I believe I'm experiencing a separate problem.

dieterholvoet’s picture

@defcon0 next time just add your changes to the existing MR. I just did, so I'm going to close your MR.

dieterholvoet changed the visibility of the branch 8.x-2.x to hidden.

  • dieterholvoet committed 3681ba7e on 8.x-2.x
    Issue #3431354 by dieterholvoet, marthinal, mandclu, defcon0: Config...
dieterholvoet’s picture

Status: Reviewed & tested by the community » Fixed

Now that this issue is closed, please review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, please credit people who helped resolve this issue.

Status: Fixed » Closed (fixed)

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