diff --git a/core/modules/content_moderation/content_moderation.module b/core/modules/content_moderation/content_moderation.module index 07ef7c083d6..7345e931dcf 100644 --- a/core/modules/content_moderation/content_moderation.module +++ b/core/modules/content_moderation/content_moderation.module @@ -72,15 +72,6 @@ function content_moderation_entity_operation(EntityInterface $entity) { ->entityOperation($entity); } -/** - * Sets required flag based on enabled state. - */ -function content_moderation_entity_bundle_field_info_alter(&$fields, EntityTypeInterface $entity_type, $bundle) { - \Drupal::service('class_resolver') - ->getInstanceFromDefinition(EntityTypeInfo::class) - ->entityBundleFieldInfoAlter($fields, $entity_type, $bundle); -} - /** * Implements hook_entity_presave(). */ diff --git a/core/modules/content_moderation/src/EntityTypeInfo.php b/core/modules/content_moderation/src/EntityTypeInfo.php index f7226dc7822..f11e4716859 100644 --- a/core/modules/content_moderation/src/EntityTypeInfo.php +++ b/core/modules/content_moderation/src/EntityTypeInfo.php @@ -333,24 +333,6 @@ class EntityTypeInfo implements ContainerInjectionInterface { return $fields; } - /** - * Adds ModerationState constraint to bundles whose entities are moderated. - * - * @param \Drupal\Core\Field\FieldDefinitionInterface[] $fields - * The array of bundle field definitions. - * @param \Drupal\Core\Entity\EntityTypeInterface $entity_type - * The entity type definition. - * @param string $bundle - * The bundle. - * - * @see hook_entity_bundle_field_info_alter(); - */ - public function entityBundleFieldInfoAlter(&$fields, EntityTypeInterface $entity_type, $bundle) { - if (!empty($fields['moderation_state']) && $this->moderationInfo->shouldModerateEntitiesOfBundle($entity_type, $bundle)) { - $fields['moderation_state']->addConstraint('ModerationState', []); - } - } - /** * Alters bundle forms to enforce revision handling. *