In #2090115: Don't install a module when its default configuration has unmet dependencies we introduce the notion of optional configuration. When a module is installed all the config/optional
directories are search for any configuration entities which have an entity type provided by the new module. This is the most basic dependency a module can have.
We can do better than this. We can determine if any optional configuration that does not exist has a dependency on the extension that is being installed and then create it if this condition is met. This means that modules can provide optional configuration the has multiple dependencies and it will be installed when all the dependencies are met.
For example, a module could provide a view which has a dependency on itself, Views and Block modules. The module itself does not have a dependency on Views or Block. It's installed before either of those modules. With HEAD if Block then Views is enabled the view will be created. If this occurred the other way around it would not be.
Comment | File | Size | Author |
---|---|---|---|
#4 | 2460847.4.patch | 9.82 KB | alexpott |
#4 | 1-4-interdiff.txt | 1.01 KB | alexpott |
#1 | 2460847.1.patch | 9.82 KB | alexpott |
Comments
Comment #1
alexpottExtracted the patch from #2460529: Migrations need to use the configuration entity dependency system and added a test.
Comment #2
rteijeiro CreditAttribution: rteijeiro commentedCode seems fine. Not sure how to manually test it.
Comment #3
Berdirdb_log => dblog?
Tested this with monitoring, removed my custom code, only did some manual tests, but worked fine for them: #2461145: Remove custom optional config installation
Comment #4
alexpottAddressing #3
Comment #5
webchickLooks good to me, has ample test coverage and docs to explain what's happening. (It is an alexpott patch, after all! :D)
Committed and pushed to 8.0.x. Thanks!