diff --git a/core/lib/Drupal/Core/Config/ConfigImporter.php b/core/lib/Drupal/Core/Config/ConfigImporter.php index f644ddd..2f6e8fe 100644 --- a/core/lib/Drupal/Core/Config/ConfigImporter.php +++ b/core/lib/Drupal/Core/Config/ConfigImporter.php @@ -254,13 +254,8 @@ public function validate() { * The name of the configuration to process. */ protected function process($op, $name) { - if ($this->checkOp($op, $name)) { - if ($entity_type = $this->configManager->getEntityTypeIdByName($name)) { - $this->importConfigurationEntity($op, $name, $entity_type); - } - else { - $this->importConfig($op, $name); - } + if (!$this->importInvokeOwner($op, $name)) { + $this->importConfig($op, $name); } } @@ -273,7 +268,7 @@ protected function process($op, $name) { * * @param string $op * The change operation. - * @param $name + * @param string $name * The name of the configuration to process. * * @return bool @@ -290,6 +285,7 @@ protected function checkOp($op, $name) { return FALSE; } break; + case 'create': if ($target_exists) { // Become an update. This is possible since updates are run after @@ -298,6 +294,7 @@ protected function checkOp($op, $name) { return FALSE; } break; + case 'update': if (!$target_exists) { // Error? @@ -341,8 +338,6 @@ protected function importConfig($op, $name) { * create or update. * @param string $name * The name of the configuration to process. - * @param string $entity_type - * The entity type of the configuration to process. * * @throws \Drupal\Core\Entity\EntityStorageException * Thrown if the data is owned by an entity type, but the entity storage @@ -380,25 +375,6 @@ protected function importInvokeOwner($op, $name) { } } - protected function importConfigurationEntity($op, $name, $entity_type) { - $old_config = new Config($name, $this->storageComparer->getTargetStorage(), $this->eventDispatcher, $this->typedConfigManager); - if ($old_data = $this->storageComparer->getTargetStorage()->read($name)) { - $old_config->initWithData($old_data); - } - - $data = $this->storageComparer->getSourceStorage()->read($name); - $new_config = new Config($name, $this->storageComparer->getTargetStorage(), $this->eventDispatcher, $this->typedConfigManager); - if ($data !== FALSE) { - $new_config->setData($data); - } - - $method = 'import' . ucfirst($op); - // Call the configuration entity's storage controller to handle the - // configuration change. - $this->configManager->getEntityManager()->getStorageController($entity_type)->$method($name, $new_config, $old_config); - $this->setProcessed($op, $name); - } - /** * Determines if a import is already running. * diff --git a/core/modules/field/lib/Drupal/field/Tests/FieldImportDeleteTest.php b/core/modules/field/lib/Drupal/field/Tests/FieldImportDeleteTest.php index 59fc321..0728ebf 100644 --- a/core/modules/field/lib/Drupal/field/Tests/FieldImportDeleteTest.php +++ b/core/modules/field/lib/Drupal/field/Tests/FieldImportDeleteTest.php @@ -6,6 +6,7 @@ */ namespace Drupal\field\Tests; + use Drupal\Component\Utility\String; /** diff --git a/core/modules/taxonomy/lib/Drupal/taxonomy/Entity/Vocabulary.php b/core/modules/taxonomy/lib/Drupal/taxonomy/Entity/Vocabulary.php index 6222a1e..ec46b6b 100644 --- a/core/modules/taxonomy/lib/Drupal/taxonomy/Entity/Vocabulary.php +++ b/core/modules/taxonomy/lib/Drupal/taxonomy/Entity/Vocabulary.php @@ -154,7 +154,7 @@ public static function postDelete(EntityStorageInterface $storage, array $entiti parent::postDelete($storage, $entities); // Reset caches. - $storage_controller->resetCache(array_keys($entities)); + $storage->resetCache(array_keys($entities)); if (reset($entities)->isSyncing()) { return;