Commit 8af814f7 authored by alexpott's avatar alexpott

Issue #2843678 by Sam152: Remove dead code in hook_entity_bundle_field_info_alter

parent 38092ac0
......@@ -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().
*/
......
......@@ -333,24 +333,6 @@ public function entityBaseFieldInfo(EntityTypeInterface $entity_type) {
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.
*
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment