diff --git a/core/modules/content_moderation/src/EventSubscriber/ConfigImportSubscriber.php b/core/modules/content_moderation/src/EventSubscriber/ConfigImportSubscriber.php index d1cd5ebaee..c97490e4fd 100644 --- a/core/modules/content_moderation/src/EventSubscriber/ConfigImportSubscriber.php +++ b/core/modules/content_moderation/src/EventSubscriber/ConfigImportSubscriber.php @@ -7,6 +7,7 @@ use Drupal\Core\Config\ConfigManagerInterface; use Drupal\Core\Config\Entity\ConfigEntityStorage; use Drupal\Core\Entity\EntityTypeManagerInterface; +use Drupal\workflows\WorkflowInterface; /** * Check moderation states are not being used before updating workflow config. @@ -89,7 +90,10 @@ protected function getWorkflow($config_name) { /** @var \Drupal\Core\Config\Entity\ConfigEntityTypeInterface $entity_type */ $entity_type = $this->entityTypeManager->getDefinition($entity_type_id, FALSE); $entity_id = ConfigEntityStorage::getIDFromConfigName($config_name, $entity_type->getConfigPrefix()); - return $this->entityTypeManager->getStorage($entity_type_id)->load($entity_id); + $entity = $this->entityTypeManager->getStorage($entity_type_id)->load($entity_id); + if ($entity instanceof WorkflowInterface) { + return $entity; + } } }