diff --git a/core/modules/content_moderation/src/Plugin/WorkflowType/ContentModeration.php b/core/modules/content_moderation/src/Plugin/WorkflowType/ContentModeration.php index c21954a..52bfcdd 100644 --- a/core/modules/content_moderation/src/Plugin/WorkflowType/ContentModeration.php +++ b/core/modules/content_moderation/src/Plugin/WorkflowType/ContentModeration.php @@ -247,15 +247,21 @@ public function buildConfigurationForm(array $form, FormStateInterface $form_sta $options = []; $defaults = []; foreach ($this->entityTypeBundleInfo->getBundleInfo($entity_type->id()) as $bundle_id => $bundle) { - $options[$bundle_id] = $bundle['label']; - $defaults[$bundle_id] = $this->appliesToEntityTypeAndBundle($entity_type->id(), $bundle_id); + 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 (!empty($options)) { + $form['attachments'][$entity_type->id()] = [ + '#type' => 'checkboxes', + '#title' => $entity_type->getLabel(), + '#options' => $options, + '#default_value' => array_keys(array_filter($defaults)), + ]; } - $form['attachments'][$entity_type->id()] = [ - '#type' => 'checkboxes', - '#title' => $entity_type->getLabel(), - '#options' => $options, - '#default_value' => array_keys(array_filter($defaults)), - ]; } return $form;