Problem
In #1806178: Remove code duplication for hook_config_import_*() implementations of config entities the hook_config_import_CRUD() hooks were removed in favor of class methods on Config Entities. This was a positive change as it reduced a lot of code duplication between the various Config Entity implementations. Unfortunately, as a side effect, only Config Entities can respond to import actions with custom code. There is no way for standard settings files to react with their own custom functionality. While there is currently no implementation that does this in core currently, it is something we are exploring as a part of #1553358: Figure out a new implementation for url aliases, and it should also exist for contrib to use.
Resolution
Restore hook_config_import_CRUD() in addition to the current Config Entity methods.
Patch to follow.
Comment | File | Size | Author |
---|---|---|---|
#8 | drupal8.config-import.8.patch | 6.71 KB | sun |
#6 | 1886478-import-hooks-6.patch | 6.45 KB | gdd |
#2 | 1886478-import-hooks-1.patch | 6.54 KB | gdd |
Comments
Comment #1
gddComment #2
gddHere's a patch, its kind of ugly though. XJM mentioned in IRC that there have been a lot of issues floating around config_import_invoke_owner() and that maybe we should consider rethinking this functionality. I'm all for that, I just don't have any big ideas right at the moment.
We will need tests specifically for both types of import as well.
Comment #3
xjmThose issues (off the top of my head) are:
Edit: In each issue, the part of the issue that pertains to
config_import_invoke_owner()
has seemed off somehow, but like @heyrocker I'm not quite sure what or how we should change it.Comment #5
chx CreditAttribution: chx commented#1881448: Improve config import system too
Comment #6
gddI know I checked that locally. *grumble*
Comment #8
sunThis should fix the failures. Also adjusted the comments a bit, and renamed the tracking variable to $handled_by_api.
Comment #10
gddClosing this as a duplicate of #1887244: use Config->save() and Config->delete() on import