diff --git a/core/modules/block/custom_block/lib/Drupal/custom_block/Entity/CustomBlockType.php b/core/modules/block/custom_block/lib/Drupal/custom_block/Entity/CustomBlockType.php index 59a4735..6431ba3 100644 --- a/core/modules/block/custom_block/lib/Drupal/custom_block/Entity/CustomBlockType.php +++ b/core/modules/block/custom_block/lib/Drupal/custom_block/Entity/CustomBlockType.php @@ -75,7 +75,7 @@ class CustomBlockType extends ConfigEntityBase implements CustomBlockTypeInterfa public function postSave(EntityStorageControllerInterface $storage_controller, $update = TRUE) { parent::postSave($storage_controller, $update); - if (!$update) { + if (!$update && !$this->isSyncing()) { entity_invoke_bundle_hook('create', 'custom_block', $this->id()); if (!$this->isSyncing()) { custom_block_add_body_field($this->id); diff --git a/core/modules/entity_reference/entity_reference.module b/core/modules/entity_reference/entity_reference.module index 4f15acd..b9aa260 100644 --- a/core/modules/entity_reference/entity_reference.module +++ b/core/modules/entity_reference/entity_reference.module @@ -74,6 +74,11 @@ function entity_reference_field_config_update(FieldConfigInterface $field) { return; } + if ($field->isSyncing()) { + // Don't change anything during a configuration sync. + return; + } + if ($field->getSetting('target_type') == $field->original->getSetting('target_type')) { // Target type didn't change. return; diff --git a/core/modules/filter/lib/Drupal/filter/Entity/FilterFormat.php b/core/modules/filter/lib/Drupal/filter/Entity/FilterFormat.php index 4e6febf..65e254f 100644 --- a/core/modules/filter/lib/Drupal/filter/Entity/FilterFormat.php +++ b/core/modules/filter/lib/Drupal/filter/Entity/FilterFormat.php @@ -238,7 +238,7 @@ public function postSave(EntityStorageControllerInterface $storage_controller, $ // Clear the filter cache whenever a text format is updated. Cache::deleteTags(array('filter_format' => $this->id())); } - else { + elseif (!$this->isSyncing()) { // Default configuration of modules and installation profiles is allowed // to specify a list of user roles to grant access to for the new format; // apply the defined user role permissions when a new format is inserted diff --git a/core/modules/image/image.module b/core/modules/image/image.module index c1420c1..ec64df3 100644 --- a/core/modules/image/image.module +++ b/core/modules/image/image.module @@ -387,6 +387,11 @@ function image_filter_keyword($value, $current_pixels, $new_pixels) { */ function image_entity_presave(EntityInterface $entity) { $field = FALSE; + + if ($entity->isSyncing()) { + return; + } + $entity_type_id = $entity->getEntityTypeId(); if ($entity_type_id == 'field_instance_config') { $field = $entity->getField(); diff --git a/core/modules/image/lib/Drupal/image/Entity/ImageStyle.php b/core/modules/image/lib/Drupal/image/Entity/ImageStyle.php index 1b3c8db..6f26574 100644 --- a/core/modules/image/lib/Drupal/image/Entity/ImageStyle.php +++ b/core/modules/image/lib/Drupal/image/Entity/ImageStyle.php @@ -105,7 +105,9 @@ public function postSave(EntityStorageControllerInterface $storage_controller, $ // The old image style name needs flushing after a rename. $this->original->flush(); // Update field instance settings if necessary. - static::replaceImageStyle($this); + if (!$this->isSyncing()) { + static::replaceImageStyle($this); + } } else { // Flush image style when updating without changing the name. @@ -126,7 +128,7 @@ public static function postDelete(EntityStorageControllerInterface $storage_cont // Check whether field instance settings need to be updated. // In case no replacement style was specified, all image fields that are // using the deleted style are left in a broken state. - if ($new_id = $style->getReplacementID()) { + if (!$style->isSyncing() && $new_id = $style->getReplacementID()) { // The deleted ID is still set as originalID. $style->setName($new_id); static::replaceImageStyle($style); diff --git a/core/modules/language/language.module b/core/modules/language/language.module index f196969..8bbcfc1 100644 --- a/core/modules/language/language.module +++ b/core/modules/language/language.module @@ -640,7 +640,7 @@ function language_modules_uninstalled($modules) { * Implements hook_language_insert(). */ function language_language_insert($language) { - if (!empty($language->locked)) { + if (!empty($language->locked) || $language->isSyncing()) { return; } diff --git a/core/modules/menu/menu.module b/core/modules/menu/menu.module index 660e1df..bdf5059 100644 --- a/core/modules/menu/menu.module +++ b/core/modules/menu/menu.module @@ -144,6 +144,11 @@ function menu_menu_insert(Menu $menu) { if (\Drupal::moduleHandler()->moduleExists('block')) { \Drupal::service('plugin.manager.block')->clearCachedDefinitions(); } + + if ($menu->isSyncing()) { + return; + } + // Make sure the menu is present in the active menus variable so that its // items may appear in the menu active trail. // See menu_set_active_menu_names(). @@ -330,6 +335,9 @@ function menu_node_update(EntityInterface $node) { * Implements hook_node_type_insert(). */ function menu_node_type_insert(NodeTypeInterface $type) { + if ($type->isSyncing()) { + return; + } \Drupal::config('menu.entity.node.' . $type->id()) ->set('available_menus', array('main')) ->set('parent', 'main:0') @@ -340,6 +348,9 @@ function menu_node_type_insert(NodeTypeInterface $type) { * Implements hook_node_type_delete(). */ function menu_node_type_delete(NodeTypeInterface $type) { + if ($type->isSyncing()) { + return; + } \Drupal::config('menu.entity.node.' . $type->id())->delete(); } diff --git a/core/modules/taxonomy/lib/Drupal/taxonomy/Entity/Vocabulary.php b/core/modules/taxonomy/lib/Drupal/taxonomy/Entity/Vocabulary.php index ee3d8f3..5b8a34e 100644 --- a/core/modules/taxonomy/lib/Drupal/taxonomy/Entity/Vocabulary.php +++ b/core/modules/taxonomy/lib/Drupal/taxonomy/Entity/Vocabulary.php @@ -102,7 +102,7 @@ public function postSave(EntityStorageControllerInterface $storage_controller, $ if (!$update) { entity_invoke_bundle_hook('create', 'taxonomy_term', $this->id()); } - elseif ($this->getOriginalId() != $this->id()) { + elseif ($this->getOriginalId() != $this->id() && !$this->isSyncing()) { // Reflect machine name changes in the definitions of existing 'taxonomy' // fields. $field_ids = array(); @@ -153,6 +153,13 @@ public static function preDelete(EntityStorageControllerInterface $storage_contr public static function postDelete(EntityStorageControllerInterface $storage_controller, array $entities) { parent::postDelete($storage_controller, $entities); + // Reset caches. + $storage_controller->resetCache(array_keys($entities)); + + if (reset($entities)->isSyncing()) { + return; + } + $vocabularies = array(); foreach ($entities as $vocabulary) { $vocabularies[$vocabulary->id()] = $vocabulary->id(); @@ -180,8 +187,6 @@ public static function postDelete(EntityStorageControllerInterface $storage_cont } } } - // Reset caches. - $storage_controller->resetCache(array_keys($vocabularies)); } }