Needs work
Project:
Drupal core
Version:
main
Component:
help.module
Priority:
Major
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
15 Nov 2023 at 14:53 UTC
Updated:
12 Feb 2026 at 12:37 UTC
Jump to comment: Most recent
In #3364108: Configuration schema & required keys, if I revert the newly added \Drupal\FunctionalTests\Update\UpdatePathTestBase::$configSchemaCheckerExclusions, then the tests fail, proving that this is indeed still necessary.
Failures:
Drupal\Tests\views\Functional\Update\ViewsFixRevisionIdUpdateTest::testViewsPostUpdateFixRevisionId
There should be no errors in configuration 'block.block.claro_help_search'. Errors:
Schema key 0 failed with: [] 'uuid' is a required key.
Failed asserting that Array &0 (
0 => '[] 'uuid' is a required key.'
) is true.
… even though that block does not exist in the update path fixture, nor is it installed prior to updates getting executed. This makes it highly likely to be caused by help_post_update_help_topics_search(), introduced in #3087499: Merge Help Topics classes into Help with BC layer.
Same thing for search.page.help_search.
block.block.stark_testblock, block.block.testblock and editor.editor.test_text_format only exist in the "filled" fixture, and cause problems only for update path tests using that one. The block portion of this is possibly caused by #3061266: Prefix block machine name suggestions with the theme machine name.
protected static $configSchemaCheckerExclusions = [
// The following config trigger config schema validation errors, even after
// the update. An update path is needed to fix these.
// @see drupal-9.4.0.filled.standard.php.gz
// @todo Remove in <follow-up issue to be created>
'block.block.claro_help_search',
'block.block.stark_testblock',
'block.block.testblock',
'editor.editor.test_text_format',
'search.page.help_search',
];
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
Comment #2
wim leersComment #3
andypostDoes it mean it needs to update dump or we can just add extra fixtures to existing dumps?
Comment #4
mxr576I have just found this issue after updated a project and realized that
help_post_update_help_topics_search()created two configs without UUIDd that also made our strict QA pipeline fail, since the exported config in config/sync differs from the active config of clean site created viadrush si -y --existing-config.This also means that a UUID gets added to these config after a clean site install and can be exported to config/sync, but it would be beneficial if a follow up update hook would be added to fix the could-be-missing UUID problem on existing projects.
Comment #5
andypost@mxr576 do you mean to add uuid generation to https://git.drupalcode.org/project/drupal/-/blob/10.2.x/core/modules/hel...
Comment #6
mxr576UUID generation was missing from there, indeed.
Now that the update hook is out, it can be fixed, but already updated sites will need a workaround for fixing the missing UUID.
In our case the CI prevented merging the change without a UUID, but others probably weren't that lucky.
Comment #7
mxr576Btw, should not config storage generate a UUID automatically when a new config is saved via standard API calls? Is there an issue for that already?
Comment #8
mxr576Maybe this would have been a scope of #2161149: Force-create new UUIDs in default config objects during initial import/creation?
Comment #11
longwaveRediscovered this over in #2544708: The `label_display` setting in `type: block_settings` has the wrong config schema type where an update hook across all blocks fails because
claro_help_searchdoes not have a UUID in the fixture database.The MR here fixes that, the uncompressed diff is:
Comment #12
longwaveHm actually this isn't quite right, I edited the fixture by hand but I think it should be exported properly, this is what I get from trying to rush this while waiting at the airport gate to fly home from Dev Days.
Comment #13
penyaskitoQuite confused by this.
\Drupal\FunctionalTests\Update\UpdatePathTestBase::$configSchemaCheckerExclusionsas in the IScore/modules/block/tests/src/Functional/BlockWeightUpdateTest.php, which usesdrupal-10.3.0.filled.standard.php.gz.Test passes. I expected it to fail.
So:
block.block.claro_help_search.yml.{a:12for the new element . Still passing.$this->assertSame('356ded34-80b4-451a-bdc4-df8d8c0931e1', Block::load('claro_help_search')->uuid());. I expected this to pass at this point, and it does.Failed asserting that null is identical to '356ded34-80b4-451a-bdc4-df8d8c0931e1'.UuidValidatorconstraint actually allows null as a valid uuid 🤯So not sure what to do next to move this forward. I still feel we need an issue for adding the uuid that went missing on the upgrade path as #5 mentioned.
I'm wondering if we should add a not null contraint to the config entity uuid schema (maybe not here but in #2161149: Force-create new UUIDs in default config objects during initial import/creation?)
Hope this throws some light here, because I was really in the dark. But still don't know what's next.
Comment #14
penyaskitoAnd for the record, we need a explicit test for that uuid upgrade with a php fixture on top of
drupal-10.3.0.filled.standard. If we add this directly todrupal-10.3.0.filled.standard.php.gz, any time it's regenerated for whatever reason, we would lose it as will not be hitting that concrete upgrade path referenced in #5.Comment #15
wim leersVirtually all validators must allow
NULLby default to avoid crashing hard on optional values.I think you're right that we're missing a
NotNullconstraint. That's also whattype: _core_config_infoetc. do.IIRC, alternatively, we could mark
type: config_entityfully validatable — I vaguely remember that causing theNotNullconstraint to be added automatically for required key-value pairs, and anytype: mappingautomatically gets all key-value pairs withoutrequiredKey: falseset to be required.Yep, confirmed, see:
—
\Drupal\Core\Config\TypedConfigManager::buildDataDefinition()Comment #17
borisson_I think we should add the NotNull Constraint, because I am not sure about marking
type: config_entityas fully validatable already.