diff --git a/core/modules/field_ui/src/EntityDisplayModeListBuilder.php b/core/modules/field_ui/src/EntityDisplayModeListBuilder.php index 1595963..a9d76ba 100644 --- a/core/modules/field_ui/src/EntityDisplayModeListBuilder.php +++ b/core/modules/field_ui/src/EntityDisplayModeListBuilder.php @@ -11,6 +11,7 @@ use Drupal\Core\Entity\EntityInterface; use Drupal\Core\Entity\EntityStorageInterface; use Drupal\Core\Entity\EntityTypeInterface; +use Drupal\Core\Link; use Drupal\Core\Url; use Symfony\Component\DependencyInjection\ContainerInterface; @@ -98,8 +99,19 @@ public function render() { continue; } + $entity_type_definition = $this->entityTypes[$entity_type]; + $label = $this->entityTypes[$entity_type]->getLabel(); + + if ($entity_type_definition->get('field_ui_base_route')) { + $entity_type_id = $entity_type_definition->id(); + $bundle_entity_type = $entity_type_definition->getBundleEntityType(); + $bundles = array_keys(\Drupal::service('entity_type.bundle.info')->getBundleInfo($entity_type)); + $bundle = reset($bundles); + $label = Link::createFromRoute($label, "entity.entity_view_display.$entity_type_id.default", [$bundle_entity_type => $bundle])->toString(); + } + $table = array( - '#prefix' => '

' . $this->entityTypes[$entity_type]->getLabel() . '

', + '#prefix' => '

' . $label . '

', '#type' => 'table', '#header' => $this->buildHeader(), '#rows' => array(),