summaryrefslogtreecommitdiffstats
path: root/core/modules/content_moderation/src/EventSubscriber/ConfigImportSubscriber.php
diff options
context:
space:
mode:
authorLee Rowlands2017-08-07 08:14:46 (GMT)
committerLee Rowlands2017-08-07 08:14:46 (GMT)
commit2534957ae1caf1275dca747b9fb8cb6f1b2a14ca (patch)
treea95ef61cb127a249e6a1d7ac4f19d7e2fadf5214 /core/modules/content_moderation/src/EventSubscriber/ConfigImportSubscriber.php
parent1da4fed2b9885e9f78dc73c235e8ebe73c84296d (diff)
Issue #2900019 by tim.plunkett, joelpittet: \Drupal\content_moderation\EventSubscriber\ConfigImportSubscriber causes errors when importing any non-workflow config
Diffstat (limited to 'core/modules/content_moderation/src/EventSubscriber/ConfigImportSubscriber.php')
-rw-r--r--core/modules/content_moderation/src/EventSubscriber/ConfigImportSubscriber.php9
1 files changed, 6 insertions, 3 deletions
diff --git a/core/modules/content_moderation/src/EventSubscriber/ConfigImportSubscriber.php b/core/modules/content_moderation/src/EventSubscriber/ConfigImportSubscriber.php
index a0598fa..930167f 100644
--- a/core/modules/content_moderation/src/EventSubscriber/ConfigImportSubscriber.php
+++ b/core/modules/content_moderation/src/EventSubscriber/ConfigImportSubscriber.php
@@ -81,15 +81,18 @@ class ConfigImportSubscriber extends ConfigImportValidateEventSubscriberBase {
* @param string $config_name
* The configuration object name.
*
- * @return \Drupal\Core\Entity\EntityInterface|null
- * An entity object. NULL if no matching entity is found.
+ * @return \Drupal\workflows\WorkflowInterface|null
+ * A workflow entity object. NULL if no matching entity is found.
*/
protected function getWorkflow($config_name) {
$entity_type_id = $this->configManager->getEntityTypeIdByName($config_name);
+ if ($entity_type_id !== 'workflow') {
+ return;
+ }
+
/** @var \Drupal\Core\Config\Entity\ConfigEntityTypeInterface $entity_type */
$entity_type = $this->entityTypeManager->getDefinition($entity_type_id);
$entity_id = ConfigEntityStorage::getIDFromConfigName($config_name, $entity_type->getConfigPrefix());
- /** @var \Drupal\workflows\WorkflowInterface $workflow */
return $this->entityTypeManager->getStorage($entity_type_id)->load($entity_id);
}