Commit 1ae26804 authored by catch's avatar catch

Issue #3204883 by anmolgoyal74, catch, RenatoG: Move exclusion of taxonomy...

Issue #3204883 by anmolgoyal74, catch, RenatoG: Move exclusion of taxonomy terms from moderation to content_moderation module
parent 1c1dbe03
......@@ -138,9 +138,13 @@ public function entityTypeAlter(array &$entity_types) {
// Workspace entities can not be moderated because they use string IDs.
// @see \Drupal\content_moderation\Entity\ContentModerationState::baseFieldDefinitions()
// where the target entity ID is defined as an integer.
// @todo Moderation is disabled for taxonomy terms until integration is
// enabled for them.
// @see https://www.drupal.org/project/drupal/issues/3047110
$entity_type_to_exclude = [
'path_alias',
'workspace',
'taxonomy_term',
];
if ($entity_type->isRevisionable() && !$entity_type->isInternal() && !in_array($entity_type_id, $entity_type_to_exclude)) {
$entity_types[$entity_type_id] = $this->addModerationToEntityType($entity_type);
......
......@@ -48,6 +48,7 @@ class ContentModerationStateTest extends KernelTestBase {
'text',
'workflows',
'path_alias',
'taxonomy',
];
/**
......@@ -787,4 +788,14 @@ protected function assertDefaultRevision(EntityInterface $entity, $revision_id,
}
}
/**
* Tests that the 'taxonomy_term' entity type cannot be moderated.
*/
public function testTaxonomyTermEntityTypeModeration() {
/** @var \Drupal\content_moderation\ModerationInformationInterface $moderation_info */
$moderation_info = \Drupal::service('content_moderation.moderation_information');
$entity_type = \Drupal::entityTypeManager()->getDefinition('taxonomy_term');
$this->assertFalse($moderation_info->canModerateEntitiesOfEntityType($entity_type));
}
}
......@@ -48,16 +48,6 @@ function taxonomy_help($route_name, RouteMatchInterface $route_match) {
}
}
/**
* Implements hook_entity_type_alter().
*/
function taxonomy_entity_type_alter(array &$entity_types) {
// @todo Moderation is disabled for taxonomy terms until integration is
// enabled for them.
// @see https://www.drupal.org/project/drupal/issues/3047110
$entity_types['taxonomy_term']->setHandlerClass('moderation', '');
}
/**
* Entity URI callback.
*/
......
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