diff --git a/core/modules/content_moderation/src/Plugin/WorkflowType/ContentModeration.php b/core/modules/content_moderation/src/Plugin/WorkflowType/ContentModeration.php index 2c67176..2559884 100644 --- a/core/modules/content_moderation/src/Plugin/WorkflowType/ContentModeration.php +++ b/core/modules/content_moderation/src/Plugin/WorkflowType/ContentModeration.php @@ -35,7 +35,7 @@ class ContentModeration extends WorkflowTypeBase implements ContainerFactoryPlug protected $entityTypeManager; /** - * Create an instance of the ContentModeration WorkflowType plugin. + * Creates an instance of the ContentModeration WorkflowType plugin. */ public function __construct(array $configuration, $plugin_id, $plugin_definition, EntityTypeManagerInterface $entity_type_manager) { parent::__construct($configuration, $plugin_id, $plugin_definition); @@ -119,7 +119,8 @@ public function getEntityTypes() { * The entity type ID to get the bundles for. * * @return string[] - * The bundles of the entity type the workflow is applied to. + * The bundles of the entity type the workflow is applied to or an empty + * array if the entity type is not applied to the workflow. */ public function getBundlesForEntityType($entity_type_id) { return isset($this->configuration['entity_types'][$entity_type_id]) ? $this->configuration['entity_types'][$entity_type_id] : []; @@ -210,9 +211,6 @@ public function onDependencyRemoval(array $dependencies) { // When bundle config entities are removed, ensure they are cleaned up from // the workflow. foreach ($dependencies['config'] as $removed_config) { - if (!($removed_config instanceof EntityInterface)) { - continue; - } if ($entity_type_id = $removed_config->getEntityType()->getBundleOf()) { $bundle_id = $removed_config->id(); $this->removeEntityTypeAndBundle($entity_type_id, $bundle_id); diff --git a/core/modules/content_moderation/tests/src/Kernel/ContentModerationStateTest.php b/core/modules/content_moderation/tests/src/Kernel/ContentModerationStateTest.php index 4b41323..af93df0 100644 --- a/core/modules/content_moderation/tests/src/Kernel/ContentModerationStateTest.php +++ b/core/modules/content_moderation/tests/src/Kernel/ContentModerationStateTest.php @@ -343,7 +343,7 @@ public function testNonBundleConfigEntityTypeModeration() { } /** - * Test the dependencies of the workflow when using content moderation. + * Tests the dependencies of the workflow when using content moderation. */ public function testWorkflowDependencies() { $node_type = NodeType::create([