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.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

gdd’s picture

Issue tags: +Configuration system
gdd’s picture

Status: Active » Needs review
FileSize
6.54 KB

Here'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.

xjm’s picture

Those 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.

Status: Needs review » Needs work

The last submitted patch, 1886478-import-hooks-1.patch, failed testing.

chx’s picture

gdd’s picture

Status: Needs work » Needs review
FileSize
6.45 KB

I know I checked that locally. *grumble*

Status: Needs review » Needs work

The last submitted patch, 1886478-import-hooks-6.patch, failed testing.

sun’s picture

Status: Needs work » Needs review
FileSize
6.71 KB

This should fix the failures. Also adjusted the comments a bit, and renamed the tracking variable to $handled_by_api.

Status: Needs review » Needs work

The last submitted patch, drupal8.config-import.8.patch, failed testing.

gdd’s picture

Status: Needs work » Closed (duplicate)