Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
In order to add an enforced dependency we duplicate information in the dependencies key.
core/modules/book/config/install/node.type.book.yml
dependencies:
module:
- book
enforced:
module:
- book
Removing this duplication make config dependencies cleaner and easier to understand. Also separating the concerns of calculating and get the list of dependencies makes the API simpler to change and maintain.
This is made worse by the fact that we don't recalculate dependencies during install - see #2520526: Calculate configuration entity dependencies on install
Comment | File | Size | Author |
---|---|---|---|
#18 | 2520540-18.patch | 52.13 KB | alexpott |
#17 | 2520540-16.patch | 93.08 KB | alexpott |
#17 | 11-16-interdiff.txt | 713 bytes | alexpott |
#11 | 2520540-11.patch | 51.43 KB | alexpott |
#11 | 2520540-11.test-only.patch | 2.15 KB | alexpott |
Comments
Comment #1
alexpottComment #2
alexpottRerolled.
Comment #5
BerdirAs discussed, it would be great if we could check the return value in the one call to calculateDependencies() that really counts and throw a helpful exception about what changed and what you need to update. Then fixing it will be easy, not too worried about that.
I counted around 5 modules/project that this breaks that I'm using.
Comment #6
Wim LeersComment #7
alexpottComment #8
Wim LeersAFAICT once this is done, this is RTBC.
Comment #9
alexpottActually it is possible to do this in a way that does not even break BC at the point that really matters :)
Comment #10
alexpottNeeds an upgrade path.
Comment #11
alexpottHere's an upgrade path and a test for it.
Comment #12
Wim LeersBook module being tested in a System module test… smells fishy. But apparently this is pre-existing.
(This really belongs in Standard AFAICT.)
Comment #13
alexpott@Wim Leers that is testing the update function provided the system module so I think it is acceptable.
Comment #17
alexpottWow that test sucks.
Comment #18
alexpottInterdiff is correct just rerolled against the wrong thing.
Comment #20
Wim Leers+1, been bit by that too :P
Comment #21
catchCommitted/pushed to 8.0.x, thanks!
Comment #23
yched CreditAttribution: yched commentedThat test is super painful indeed :-/
(and #2578249: Some e_r fields get the wrong Selection handler, that has to do the same, will need a reroll :-p)
Comment #27
alexpott