Skip to content
Snippets Groups Projects
Commit 8af814f7 authored by Alex Pott's avatar Alex Pott
Browse files

Issue #2843678 by Sam152: Remove dead code in hook_entity_bundle_field_info_alter

parent 38092ac0
No related branches found
No related tags found
2 merge requests!7452Issue #1797438. HTML5 validation is preventing form submit and not fully...,!789Issue #3210310: Adjust Database API to remove deprecated Drupal 9 code in Drupal 10
...@@ -72,15 +72,6 @@ function content_moderation_entity_operation(EntityInterface $entity) { ...@@ -72,15 +72,6 @@ function content_moderation_entity_operation(EntityInterface $entity) {
->entityOperation($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(). * Implements hook_entity_presave().
*/ */
......
...@@ -333,24 +333,6 @@ public function entityBaseFieldInfo(EntityTypeInterface $entity_type) { ...@@ -333,24 +333,6 @@ public function entityBaseFieldInfo(EntityTypeInterface $entity_type) {
return $fields; 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. * Alters bundle forms to enforce revision handling.
* *
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment