Needs work
Project:
Drupal core
Version:
main
Component:
configuration system
Priority:
Major
Category:
Bug report
Assigned:
Issue tags:
Reporter:
Created:
27 Jan 2015 at 11:34 UTC
Updated:
9 Jul 2026 at 20:07 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
alexpottLet's see what breaks. I've created #2414953: Element uses \Drupal::service() as a service locator and prevents injecting a custom typed config manager in config to handle something we need to do even if we decide not to do this.
Comment #2
alexpottComment #3
alexpottAlso to make this performant we really need to get #2411689: Use a MemoryBackend in StorageComparer so that configuration import validators don't have to reread data from disk or the db done. Since without that we'll be reading all the configuration many many times.
Comment #4
gábor hojtsyI think this is a great idea.
This is great, but would be a different issue, no?
If we want to keep the schema optional, we should not make this condition an error.
Comment #6
alexpottRebased the patch on the latest in #2414953: Element uses \Drupal::service() as a service locator and prevents injecting a custom typed config manager in config and refactored the event to make it as easy as possible to read. Also surprise surprise we found some invalid config lying about :).
Re #4.1 yep - going to create a new issue.
Re #4.2 yep - fixed.
We need to add some tests of schema errors being caught. The ConfigImportAll test is proof that schema validation for uninstalled modules is working nicely.
Comment #7
gábor hojtsyI think its key to have a module installed in that test.
Comment #8
berdirSo what exactly happens if an error is logged? Does it still import or is it aborted?
Enforcing that only valid configuration can be imported seems like a huge change to HEAD, there are still modules that don't have valid configuration schema.
Comment #9
alexpottI talked about this with @Berdir in IRC - he's in favour of moving this to contrib since partial or wrong schemas are common in contrib. One problem with this is that how will they ever get fixed?
Comment #10
gábor hojtsyI hope translators will put some pressure on them (oh, did I write that?) I mean they will help fix things.
Comment #11
berdirOne option would be some kind of warnings, that aren't blocking the import. (a collapsed fieldset that lists the first few, or something).
We have tests that validate it by default, and I think the test coverage for frequently used contrib modules will be much better in 8.x than it was in earlier versions.
Comment #15
anavarreComment #20
james.williamsComment #21
savkaviktor16@gmail.com commentedRe-rolled
Comment #22
savkaviktor16@gmail.com commentedComment #25
tr commentedComment #26
wim leersMarked #2971727: Validate configuration upon saving (prevents invalid config imports a.o.) as a duplicate of this.
Comment #27
effulgentsia commentedReroll
Comment #36
wim leersAs of #2164373-34: [META] Untie config validation from form validation — enables validatable Recipes, decoupled admin UIs …, this is starting to become more important 😊
Comment #37
ravi.shankar commentedWorking on it.
Comment #38
ravi.shankar commentedAdded reroll of patch #27 on Drupal 10.1.x.
Comment #40
wim leersComment #41
wim leersThis is now actually becoming feasible and hence relevant — see #3324984-33: Create test that reports % of config entity types (and config schema types) that is validatable 😊
Comment #45
bbralaRebased and brought codestyle (and phpstan) up to par.
Comment #47
wim leersDue to this core bug (I don't see how importing invalid config without complaining cannot be a bug, especially after #3347842: Deprecate the trusted data concept in configuration), Canvas was forced last night to introduce a custom
ConfigImportValidateEventSubscriberBaseto ensure config schema validation constraints are not violated.It basically does for a single specific piece of config what this issue's MR (https://git.drupalcode.org/project/drupal/-/merge_requests/8519) does generically.
Comment #48
phenaproximaI read the MR and the direction makes sense to me. What's needed is significant test coverage:
Did I miss anything?
Comment #50
phenaproximaOpened !16269 with tests covering everything in #48 except for applying a recipe at install time. Testing the installer is "fun" and needs a deft touch.
The tests fail as expected.
This MR was generated with the help of an LLM but I was closely guiding the work session and reviewed the output thoroughly.
Comment #51
phenaproximaOK, I've got some questions after hacking on this a bit: