Problem/Motivation
During #2834768: Route alteration refactor the Taxonomy term integration are loose ... We need to investigate of that and come back that integration.
I think is due to that function changes :
function form_mode_manager_entity_type_alter(array &$entity_types) {
/** @var \Drupal\Core\Entity\EntityDisplayRepository[] $display_modes_list */
$form_modes = \Drupal::service('entity_display.repository')->getAllFormModes();
foreach ($form_modes as $entity_type => $display_modes) {
/* @var \Drupal\Core\Entity\EntityTypeInterface $entity */
$entity = $entity_types[$entity_type];
unset($display_modes['register']);
foreach ($display_modes as $machine_name => $form_display) {
if ($entity->hasViewBuilderClass() && $entity->hasLinkTemplate('canonical')) {
$default_handler_class = $entity->getHandlerClasses()['form']['default'];
$entity->setFormClass($machine_name, $default_handler_class)
->setLinkTemplate($machine_name, "/{$entity->id()}/{{$entity_type}}/$machine_name");
}
}
}
}
before we have :
/**
* Implements hook_entity_type_alter().
*
* Create one operation by modes available on each entities,
* available to use form modes. In that moment we don't need,
* to filter modes by enable or not on entities.
*/
function form_mode_manager_entity_type_alter(array &$entity_types) {
/** @var \Drupal\Core\Entity\EntityDisplayRepository[] $display_modes_list */
$form_modes = \Drupal::service('entity_display.repository')->getAllFormModes();
foreach ($form_modes as $entity_type => $display_modes) {
/* @var \Drupal\Core\Entity\EntityTypeInterface $entity */
$entity = $entity_types[$entity_type];
unset($display_modes['register']);
foreach ($display_modes as $machine_name => $form_display) {
// Format path more standard as possible unfortunlly,
// we have any information to identify correctly all possibles routes.
$path = $entity->getLinkTemplate('canonical') . "/$machine_name";
$default_handler_class = $entity->getHandlerClasses()['form']['default'];
$entity->setFormClass($machine_name, $default_handler_class)
->setLinkTemplate($machine_name, $path);
}
}
}
Proposed resolution
I suppose that bug is due to "non-standard" path for Taxonomy terms like "admin/..." not "entity_id/entity_type/form_display"
Comments
Comment #2
woprrr commentedThat fix the problem. We need to wait an core change to have a better solution for entity operations list.
Comment #3
woprrr commentedComment #4
woprrr commented