diff --git a/core/modules/content_moderation/src/EntityOperations.php b/core/modules/content_moderation/src/EntityOperations.php index 2b11b5e45c..52553e1fc8 100644 --- a/core/modules/content_moderation/src/EntityOperations.php +++ b/core/modules/content_moderation/src/EntityOperations.php @@ -159,6 +159,9 @@ public function entityUpdate(EntityInterface $entity) { } if ($entity->getEntityTypeId() == 'workflow' && $entity->get('type') === 'content_moderation') { + // For performance reasons we're updating the data table and revision + // table directly. This bypasses the entity api, but because the + // content_moderation_state entity type is @internal this is fine. $deleted_states = array_diff_key($entity->original->getStates(), $entity->getStates()); /** @var \Drupal\content_moderation\ContentModerationState $deleted_state */ foreach ($deleted_states as $deleted_state) { @@ -175,6 +178,7 @@ public function entityUpdate(EntityInterface $entity) { ->fields(['moderation_state' => $new_state]) ->execute(); } + $this->entityTypeManager->getStorage('content_moderation_state')->resetCache(); } }