diff --git a/core/lib/Drupal/Core/Entity/EntityManager.php b/core/lib/Drupal/Core/Entity/EntityManager.php index 11b3fef..5a3c22d 100644 --- a/core/lib/Drupal/Core/Entity/EntityManager.php +++ b/core/lib/Drupal/Core/Entity/EntityManager.php @@ -332,20 +332,6 @@ public function getController($entity_type, $controller_type, $controller_class_ /** * {@inheritdoc} */ - public function getAdminRouteInfo($entity_type_id, $bundle) { - if (($entity_type = $this->getDefinition($entity_type_id, FALSE)) && $route_name = $entity_type->get('field_ui_base_route')) { - return array( - 'route_name' => $route_name, - 'route_parameters' => array( - $entity_type->getBundleEntityType() => $bundle, - ), - ); - } - } - - /** - * {@inheritdoc} - */ public function getBaseFieldDefinitions($entity_type_id) { // Check the static cache. if (!isset($this->baseFieldDefinitions[$entity_type_id])) { diff --git a/core/lib/Drupal/Core/Entity/EntityManagerInterface.php b/core/lib/Drupal/Core/Entity/EntityManagerInterface.php index f5c2374..18c7c8b 100644 --- a/core/lib/Drupal/Core/Entity/EntityManagerInterface.php +++ b/core/lib/Drupal/Core/Entity/EntityManagerInterface.php @@ -117,22 +117,6 @@ public function getFieldMapByFieldType($field_type); public function getAccessControlHandler($entity_type); /** - * Returns the route information for an entity type's bundle. - * - * @param string $entity_type_id - * The entity type. - * @param string $bundle - * The name of the bundle. - * - * @return array - * An associative array with the following keys: - * - route_name: The name of the route. - * - route_parameters: (optional) An associative array of parameter names - * and values. - */ - public function getAdminRouteInfo($entity_type_id, $bundle); - - /** * Creates a new storage instance. * * @param string $entity_type diff --git a/core/modules/field_ui/src/Plugin/Derivative/FieldUiLocalTask.php b/core/modules/field_ui/src/Plugin/Derivative/FieldUiLocalTask.php index e473663..758a98b 100644 --- a/core/modules/field_ui/src/Plugin/Derivative/FieldUiLocalTask.php +++ b/core/modules/field_ui/src/Plugin/Derivative/FieldUiLocalTask.php @@ -171,20 +171,20 @@ public function getDerivativeDefinitions($base_plugin_definition) { * An array of local tasks plugin definitions, keyed by plugin ID. */ public function alterLocalTasks(&$local_tasks) { - foreach ($this->entityManager->getDefinitions() as $entity_type => $entity_info) { - if ($entity_info->isFieldable() && $route_name = $entity_info->get('field_ui_base_route')) { - $local_tasks["field_ui.fields:overview_$entity_type"]['base_route'] = $route_name; - $local_tasks["field_ui.fields:form_display_overview_$entity_type"]['base_route'] = $route_name; - $local_tasks["field_ui.fields:display_overview_$entity_type"]['base_route'] = $route_name; - $local_tasks["field_ui.fields:field_form_display_default_$entity_type"]['base_route'] = $route_name; - $local_tasks["field_ui.fields:field_display_default_$entity_type"]['base_route'] = $route_name; - - foreach ($this->entityManager->getFormModes($entity_type) as $form_mode => $form_mode_info) { - $local_tasks['field_ui.fields:field_form_display_' . $form_mode . '_' . $entity_type]['base_route'] = $route_name; + foreach ($this->entityManager->getDefinitions() as $entity_type_id => $entity_type) { + if ($entity_type->isFieldable() && $route_name = $entity_type->get('field_ui_base_route')) { + $local_tasks["field_ui.fields:overview_$entity_type_id"]['base_route'] = $route_name; + $local_tasks["field_ui.fields:form_display_overview_$entity_type_id"]['base_route'] = $route_name; + $local_tasks["field_ui.fields:display_overview_$entity_type_id"]['base_route'] = $route_name; + $local_tasks["field_ui.fields:field_form_display_default_$entity_type_id"]['base_route'] = $route_name; + $local_tasks["field_ui.fields:field_display_default_$entity_type_id"]['base_route'] = $route_name; + + foreach ($this->entityManager->getFormModes($entity_type_id) as $form_mode => $form_mode_info) { + $local_tasks['field_ui.fields:field_form_display_' . $form_mode . '_' . $entity_type_id]['base_route'] = $route_name; } - foreach ($this->entityManager->getViewModes($entity_type) as $view_mode => $form_mode_info) { - $local_tasks['field_ui.fields:field_display_' . $view_mode . '_' . $entity_type]['base_route'] = $route_name; + foreach ($this->entityManager->getViewModes($entity_type_id) as $view_mode => $form_mode_info) { + $local_tasks['field_ui.fields:field_display_' . $view_mode . '_' . $entity_type_id]['base_route'] = $route_name; } } } diff --git a/core/tests/Drupal/Tests/Core/Entity/EntityManagerTest.php b/core/tests/Drupal/Tests/Core/Entity/EntityManagerTest.php index 1edd2dc..96db075 100644 --- a/core/tests/Drupal/Tests/Core/Entity/EntityManagerTest.php +++ b/core/tests/Drupal/Tests/Core/Entity/EntityManagerTest.php @@ -437,36 +437,6 @@ public function testGetControllerMissingController() { } /** - * Tests the getAdminRouteInfo() method. - * - * @covers ::getAdminRouteInfo() - */ - public function testGetAdminRouteInfo() { - $apple = $this->getMock('Drupal\Core\Entity\EntityTypeInterface'); - $banana = $this->getMock('Drupal\Core\Entity\EntityTypeInterface'); - $banana->expects($this->once()) - ->method('getBundleEntityType') - ->will($this->returnValue('bundle')); - $banana->expects($this->once()) - ->method('get') - ->with('field_ui_base_route') - ->will($this->returnValue('entity.view')); - $this->setUpEntityManager(array( - 'apple' => $apple, - 'banana' => $banana, - )); - - $expected = array( - 'route_name' => 'entity.view', - 'route_parameters' => array( - 'bundle' => 'chiquita', - ), - ); - $this->assertSame($expected, $this->entityManager->getAdminRouteInfo('banana', 'chiquita')); - $this->assertNull($this->entityManager->getAdminRouteInfo('apple', 'delicious')); - } - - /** * Tests the getBaseFieldDefinitions() method. * * @covers ::getBaseFieldDefinitions()