Problem/Motivation
We like how configuration dependency system works. We like onDependencyRemoval(), but we miss so much an onDependencyUpdating().
Proposed resolution
Allow configuration entities to react on their dependencies update:
- Add a new listener
onDependencyUpdating()on config entities. - Assure BC for Drupal 8.
- One use-case conversion: In editor.module, convert
editor_filter_format_presave()(hook_ENTITY_TYPE_presave()) inEditor::onDependencyUpdating(). This hook implementation has already tests.
Remaining tasks
- Fill an issue for D9 to remove the BC layer.
- Discuss the opportunity to add more fine grained events: onEnable, onDisable, onIdRename, etc.
User interface changes
None.
API changes
New interfaces and methods:
ConfigManagerDependencyFinderInterface implemented by ConfigManager
getConfigEntitiesToChange()
ConfigEntityDependencyResolverInterface implemented by ConfigEntityBase
onDependencyUpdating()setDependencyResolved()isDependencyResolved()
Data model changes
None.
| Comment | File | Size | Author |
|---|---|---|---|
| #29 | ondependencyupdating-2647576-29.patch | 34.53 KB | claudiu.cristea |
Comments
Comment #2
claudiu.cristeaA first PoC patch. the test is already there, in the Editor module.
Comment #4
claudiu.cristeaFixed unit tests.
Comment #6
claudiu.cristeaCloser...
Comment #7
claudiu.cristeaIS, title.
Comment #8
claudiu.cristeaComment #9
claudiu.cristeaAdded tests, fixed docs.
Comment #10
claudiu.cristeaIS.
Comment #11
claudiu.cristeaMore docs fixes.
Comment #12
claudiu.cristeaImproved the kernel test to test cascading updates. Other doc fixes.
Comment #14
claudiu.cristeaFixed the unit test.
Comment #15
claudiu.cristeaOther docs fixes.
Comment #16
dawehnerToo tired to do a proper review now, sorry.
It would be nice if the issue summary could describe the usecase here ...
Mh, is that really an assumption we can make? What happens if people have different config entities? IMHO we need instanceof checks
Comment #17
claudiu.cristea@alexpott, while you wrote the dependency management I would like to hear an opinion on this patch. The tests are passing nice and there's no BC break.
Comment #19
claudiu.cristeaComment #20
kostyashupenkoRerolled patch from https://www.drupal.org/node/2647576#comment-10740126
Comment #22
claudiu.cristeaComment #23
kostyashupenkoReroll of #15. Needs review, because a lot new changes for the files in this patch, that came from 12 jan 2016. There were a lot of conflicts, while I was doing this reroll
Comment #25
claudiu.cristeaComment #27
claudiu.cristeaThis is not an easy reroll.
Comment #29
claudiu.cristeaSorry, the patch was incomplete.
Comment #39
alexpottI'm not sure we need this extra level. The entity hooks already allow us to hook into an entity save. The dependency removal stuff is a special situation. Is there anything this new event would allow us to do we can't at the moment?