currently, we allow modules that define config entities to signal that they are not going to handle a change during import by returning false from StorageController::importChange/Delete/New implementations.

this is probably not safe, as we enforce different rules for plain old config objects (POCOs) vs plain old config entity objects (POCEOs).

with POCOs, key changes within a config file are fine, with POCEOs, they are not.

so this patch unconditionally removes any files from the list of import changes that are passed to config_import_invoke_owner().

Files: 
CommentFileSizeAuthor
#3 config-1887304-3.patch1.52 KBtim.plunkett
FAILED: [[SimpleTest]]: [MySQL] Unable to apply patch config-1887304-3.patch. Unable to apply patch. See the log in the details link for more information. View
#1 1887304-poco-vs-pocoe.patch622 bytesbeejeebus
PASSED: [[SimpleTest]]: [MySQL] 49,667 pass(es). View

Comments

beejeebus’s picture

Status: Active » Needs review
Issue tags: +Configuration system
FileSize
622 bytes
PASSED: [[SimpleTest]]: [MySQL] 49,667 pass(es). View

and here's the simple patch.

beejeebus’s picture

Component: configuration system » configuration entity system

changing component. not sure.

tim.plunkett’s picture

FileSize
1.52 KB
FAILED: [[SimpleTest]]: [MySQL] Unable to apply patch config-1887304-3.patch. Unable to apply patch. See the log in the details link for more information. View

If we do, we should clean up the methods as well.
However, not sure how to combine this with #1886478: Bring back hook_config_import_CRUD() hooks

sun’s picture

Issue tags: +Configurables

Hm. I've to admit that I did not understand the problem space that is described in the OP. Can we clarify that?

+++ b/core/lib/Drupal/Core/Config/Entity/ConfigStorageController.php
@@ -443,7 +443,6 @@ public function getQueryServicename() {
     $entity->save();
-    return TRUE;

@@ -474,7 +473,6 @@ public function importChange($name, Config $new_config, Config $old_config) {
     $entity->save();
-    return TRUE;

In any case, we probably want to return the result of ::save() here.

tim.plunkett’s picture

+++ b/core/includes/config.incundefined
@@ -271,9 +271,7 @@ function config_import_invoke_owner(array $config_changes, StorageInterface $sou
+        entity_get_controller($entity_type)->$method($name, $new_config, $old_config);

We can return whatever we want, we don't check it anywhere.

jibran’s picture

#3: config-1887304-3.patch queued for re-testing.

Status: Needs review » Needs work
Issue tags: +Configuration system, +Configurables

The last submitted patch, config-1887304-3.patch, failed testing.

mtift’s picture

Title: don't pass config changes through config_sync_changes() for config entities » Don't pass config changes through ConfigImporter::importInvokeOwner() for config entities
Issue tags: +Needs issue summary update
tim.plunkett’s picture

Issue summary: View changes
Status: Needs work » Closed (duplicate)