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 345c210e7df..c6340c64177 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 @@ -87,7 +87,9 @@ class CustomBlockType extends ConfigEntityBase implements CustomBlockTypeInterfa if (!$update) { entity_invoke_bundle_hook('create', 'custom_block', $this->id()); - custom_block_add_body_field($this->id); + if (!$this->isSyncing()) { + custom_block_add_body_field($this->id); + } } elseif ($this->getOriginalId() != $this->id) { entity_invoke_bundle_hook('rename', 'custom_block', $this->getOriginalId(), $this->id); diff --git a/core/modules/comment/comment.module b/core/modules/comment/comment.module index 6fcbc2be43a..f4533d92273 100644 --- a/core/modules/comment/comment.module +++ b/core/modules/comment/comment.module @@ -251,7 +251,7 @@ function comment_count_unpublished() { * Implements hook_ENTITY_TYPE_create() for 'field_instance'. */ function comment_field_instance_create(FieldInstanceInterface $instance) { - if ($instance->getFieldType() == 'comment') { + if ($instance->getFieldType() == 'comment' && !$instance->isSyncing()) { \Drupal::service('comment.manager')->addBodyField($instance->entity_type, $instance->getFieldName()); \Drupal::cache()->delete('comment_entity_info'); // Assign default values for the field instance. diff --git a/core/modules/user/user.module b/core/modules/user/user.module index 5751f027366..91e18d58611 100644 --- a/core/modules/user/user.module +++ b/core/modules/user/user.module @@ -1433,8 +1433,8 @@ function user_role_names($membersonly = FALSE, $permission = NULL) { * Implements hook_user_role_insert(). */ function user_user_role_insert(RoleInterface $role) { - // Ignore the authenticated and anonymous roles. - if (in_array($role->id(), array(DRUPAL_AUTHENTICATED_RID, DRUPAL_ANONYMOUS_RID))) { + // Ignore the authenticated and anonymous roles or the role is being synced. + if (in_array($role->id(), array(DRUPAL_AUTHENTICATED_RID, DRUPAL_ANONYMOUS_RID)) || $role->isSyncing()) { return; } @@ -1470,8 +1470,8 @@ function user_user_role_insert(RoleInterface $role) { * Implements hook_user_role_delete(). */ function user_user_role_delete(RoleInterface $role) { - // Ignore the authenticated and anonymous roles. - if (in_array($role->id(), array(DRUPAL_AUTHENTICATED_RID, DRUPAL_ANONYMOUS_RID))) { + // Ignore the authenticated and anonymous roles or the role is being synced. + if (in_array($role->id(), array(DRUPAL_AUTHENTICATED_RID, DRUPAL_ANONYMOUS_RID)) || $role->isSyncing()) { return; }