diff --git a/core/modules/content_moderation/src/Plugin/WorkflowType/ContentModeration.php b/core/modules/content_moderation/src/Plugin/WorkflowType/ContentModeration.php index ec37dd3..9f5c9a2 100644 --- a/core/modules/content_moderation/src/Plugin/WorkflowType/ContentModeration.php +++ b/core/modules/content_moderation/src/Plugin/WorkflowType/ContentModeration.php @@ -230,11 +230,20 @@ public function editForm(WorkflowInterface $workflow) { if ($this->moderationInfo->canModerateEntitiesOfEntityType($entity_type)) { $options = []; $defaults = []; - $bundles = $this->entityTypeManager->getStorage($entity_type->getBundleEntityType())->loadMultiple(); - foreach ($bundles as $bundle) { - if (!$this->moderationInfo->shouldModerateEntitiesOfBundle($entity_type, $bundle->id()) || $this->appliesToEntityTypeAndBundle($entity_type->id(), $bundle->id())) { - $options[$bundle->id()] = $bundle->label(); - $defaults[$bundle->id()] = $this->appliesToEntityTypeAndBundle($entity_type->id(), $bundle->id()); + if ($entity_type->getBundleEntityType()) { + $bundles = $this->entityTypeManager->getStorage($entity_type->getBundleEntityType()) + ->loadMultiple(); + foreach ($bundles as $bundle) { + if (!$this->moderationInfo->shouldModerateEntitiesOfBundle($entity_type, $bundle->id()) || $this->appliesToEntityTypeAndBundle($entity_type->id(), $bundle->id())) { + $options[$bundle->id()] = $bundle->label(); + $defaults[$bundle->id()] = $this->appliesToEntityTypeAndBundle($entity_type->id(), $bundle->id()); + } + } + } + else { + if (!$this->moderationInfo->shouldModerateEntitiesOfBundle($entity_type, $entity_type->id()) || $this->appliesToEntityTypeAndBundle($entity_type->id(), $entity_type->id())) { + $options[$entity_type->id()] = $entity_type->getLabel(); + $defaults[$entity_type->id()] = $this->appliesToEntityTypeAndBundle($entity_type->id(), $entity_type->id()); } } diff --git a/sites/default/default.services.yml b/sites/default/default.services.yml old mode 100644 new mode 100755