diff --git a/core/lib/Drupal/Core/Config/ConfigImporter.php b/core/lib/Drupal/Core/Config/ConfigImporter.php index 8888b4e..6f1a173 100644 --- a/core/lib/Drupal/Core/Config/ConfigImporter.php +++ b/core/lib/Drupal/Core/Config/ConfigImporter.php @@ -292,10 +292,18 @@ protected function checkOp($op, $name) { case 'create': if ($target_exists) { - // Become an update. This is possible since updates are run after - // creates. - $this->storageComparer->swapOp('create', 'update', $name); - return FALSE; + // If the target already exists, use the entity storage to delete it + // again, if is a simple config, delete it directly. + if ($entity_type_id = $this->configManager->getEntityTypeIdByName($name)) { + $entity_storage = $this->configManager->getEntityManager()->getStorage($entity_type_id); + $entity_type = $this->configManager->getEntityManager()->getDefinition($entity_type_id); + $entity = $entity_storage->load($entity_storage->getIDFromConfigName($name, $entity_type->getConfigPrefix())); + $entity->delete(); + } + else { + $this->storageComparer->getTargetStorage()->delete($name); + } + return TRUE; } break;