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"

CommentFileSizeAuthor
#2 taxonomy_term_support-2838087-2.patch8.05 KBwoprrr

Comments

woprrr created an issue. See original summary.

woprrr’s picture

StatusFileSize
new8.05 KB

That fix the problem. We need to wait an core change to have a better solution for entity operations list.

woprrr’s picture

Status: Active » Needs review
woprrr’s picture

Status: Needs review » Fixed

  • woprrr committed 6d42c7f on 8.x-1.x
    Issue #2838087 by woprrr: taxonomy_term support break during refactor
    

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.