diff --git a/core/lib/Drupal/Core/Entity/EntityManager.php b/core/lib/Drupal/Core/Entity/EntityManager.php index b9081d2..66ef2a6 100644 --- a/core/lib/Drupal/Core/Entity/EntityManager.php +++ b/core/lib/Drupal/Core/Entity/EntityManager.php @@ -331,20 +331,6 @@ public function getHandler($entity_type, $handler_type) { /** * {@inheritdoc} */ - public function getAdminRouteInfo($entity_type_id, $bundle) { - if (($entity_type = $this->getDefinition($entity_type_id, FALSE)) && $entity_type->getLinkTemplate('admin-form')) { - return array( - 'route_name' => "entity.$entity_type_id.admin_form", - '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/Plugin/DefaultPluginManager.php b/core/lib/Drupal/Core/Plugin/DefaultPluginManager.php index 6223bc8..a2d4cf2 100644 --- a/core/lib/Drupal/Core/Plugin/DefaultPluginManager.php +++ b/core/lib/Drupal/Core/Plugin/DefaultPluginManager.php @@ -179,7 +179,7 @@ public function clearCachedDefinitions() { * and would actually be returned by the getDefinitions() method. */ protected function getCachedDefinitions() { - if (FALSE && !isset($this->definitions) && $this->cacheBackend && $cache = $this->cacheBackend->get($this->cacheKey)) { + if (!isset($this->definitions) && $this->cacheBackend && $cache = $this->cacheBackend->get($this->cacheKey)) { $this->definitions = $cache->data; } return $this->definitions; diff --git a/core/modules/comment/src/Form/CommentAdminOverview.php b/core/modules/comment/src/Form/CommentAdminOverview.php index 723241a..f0f623c 100644 --- a/core/modules/comment/src/Form/CommentAdminOverview.php +++ b/core/modules/comment/src/Form/CommentAdminOverview.php @@ -224,7 +224,7 @@ public function buildForm(array $form, FormStateInterface $form_state, $type = ' if ($this->moduleHandler->moduleExists('content_translation') && $this->moduleHandler->invoke('content_translation', 'translate_access', array($comment))->isAllowed()) { $links['translate'] = array( 'title' => $this->t('Translate'), - 'route_name' => 'content_translation.translation_overview_comment', + 'route_name' => 'entity.comment.content_translation_overview', 'route_parameters' => array('comment' => $comment->id()), 'options' => $comment_uri_options, 'query' => $destination, diff --git a/core/modules/content_translation/content_translation.module b/core/modules/content_translation/content_translation.module index 1119ab8..b7a4aa5 100644 --- a/core/modules/content_translation/content_translation.module +++ b/core/modules/content_translation/content_translation.module @@ -115,7 +115,7 @@ function content_translation_entity_type_alter(array &$entity_types) { if ($entity_type->hasLinkTemplate('canonical')) { // Provide default route names for the translation paths. if (!$entity_type->hasLinkTemplate('drupal:content-translation-overview')) { - $entity_type->setLinkTemplate('drupal:content-translation-overview', "content_translation.translation_overview_" . $entity_type->id()); + $entity_type->setLinkTemplate('drupal:content-translation-overview', "entity.{$entity_type->id()}.content_translation_overview"); } // @todo Remove this as soon as menu access checks rely on the // controller. See https://drupal.org/node/2155787. diff --git a/core/modules/field/src/Entity/FieldConfig.php b/core/modules/field/src/Entity/FieldConfig.php index d95ed00..d452f46 100644 --- a/core/modules/field/src/Entity/FieldConfig.php +++ b/core/modules/field/src/Entity/FieldConfig.php @@ -258,9 +258,9 @@ public static function postDelete(EntityStorageInterface $storage, array $fields protected function linkTemplates() { $link_templates = parent::linkTemplates(); if (\Drupal::moduleHandler()->moduleExists('field_ui')) { - $link_templates["field_ui.instance-{$this->entity_type}-edit-form"] = 'field_ui.field_edit_' . $this->entity_type; + $link_templates["field_ui.field-{$this->entity_type}-edit-form"] = 'field_ui.field_edit_' . $this->entity_type; $link_templates["field_ui.storage-{$this->entity_type}-edit-form"] = 'field_ui.storage_edit_' . $this->entity_type; - $link_templates["field_ui.{$this->entity_type}-delete-form"] = 'field_ui.delete_' . $this->entity_type; + $link_templates["field_ui.field-{$this->entity_type}-delete-form"] = 'field_ui.field_delete_' . $this->entity_type; if (isset($link_templates['drupal:config-translation-overview'])) { $link_templates['drupal:config-translation-overview' . "field_ui.field-{$this->entity_type}-edit-form"] .= $link_templates["field_ui.instance-{$this->entity_type}-edit-form"]; diff --git a/core/modules/field_ui/field_ui.module b/core/modules/field_ui/field_ui.module index 8047362..34fc982 100644 --- a/core/modules/field_ui/field_ui.module +++ b/core/modules/field_ui/field_ui.module @@ -298,8 +298,8 @@ function field_ui_entity_type_alter(array &$entity_types) { $form_mode->setFormClass('edit', 'Drupal\field_ui\Form\EntityDisplayModeEditForm'); $form_mode->setFormClass('delete', 'Drupal\field_ui\Form\EntityDisplayModeDeleteForm'); $form_mode->set('admin_permission', 'administer display modes'); - $form_mode->setLinkTemplate('delete-form', 'field_ui.entity_form_mode.delete_form'); - $form_mode->setLinkTemplate('edit-form', 'field_ui.entity_form_mode.edit_form'); + $form_mode->setLinkTemplate('delete-form', 'entity.entity_form_mode.delete_form'); + $form_mode->setLinkTemplate('edit-form', 'entity.entity_form_mode.edit_form'); $view_mode = $entity_types['entity_view_mode']; $view_mode->setListBuilderClass('Drupal\field_ui\EntityDisplayModeListBuilder'); @@ -307,6 +307,6 @@ function field_ui_entity_type_alter(array &$entity_types) { $view_mode->setFormClass('edit', 'Drupal\field_ui\Form\EntityDisplayModeEditForm'); $view_mode->setFormClass('delete', 'Drupal\field_ui\Form\EntityDisplayModeDeleteForm'); $view_mode->set('admin_permission', 'administer display modes'); - $view_mode->setLinkTemplate('delete-form', 'field_ui.entity_view_mode.delete_form'); - $view_mode->setLinkTemplate('edit-form', 'field_ui.entity_view_mode.edit_form'); + $view_mode->setLinkTemplate('delete-form', 'entity.entity_view_mode.delete_form'); + $view_mode->setLinkTemplate('edit-form', 'entity.entity_view_mode.edit_form'); } diff --git a/core/modules/field_ui/field_ui.routing.yml b/core/modules/field_ui/field_ui.routing.yml index cc17e94..4e03cb2 100644 --- a/core/modules/field_ui/field_ui.routing.yml +++ b/core/modules/field_ui/field_ui.routing.yml @@ -38,7 +38,7 @@ field_ui.entity_view_mode_add_type: requirements: _permission: 'administer display modes' -field_ui.entity_view_mode.edit_form: +entity.entity_view_mode.edit_form: path: '/admin/structure/display-modes/view/manage/{entity_view_mode}' defaults: _entity_form: 'entity_view_mode.edit' @@ -46,7 +46,7 @@ field_ui.entity_view_mode.edit_form: requirements: _entity_access: 'entity_view_mode.update' -field_ui.entity_view_mode.delete_form: +entity.entity_view_mode.delete_form: path: '/admin/structure/display-modes/view/manage/{entity_view_mode}/delete' defaults: _entity_form: 'entity_view_mode.delete' @@ -78,7 +78,7 @@ field_ui.entity_form_mode_add_type: requirements: _permission: 'administer display modes' -field_ui.entity_form_mode.edit_form: +entity.entity_form_mode.edit_form: path: '/admin/structure/display-modes/form/manage/{entity_form_mode}' defaults: _entity_form: 'entity_form_mode.edit' @@ -86,7 +86,7 @@ field_ui.entity_form_mode.edit_form: requirements: _entity_access: 'entity_form_mode.update' -field_ui.entity_form_mode.delete_form: +entity.entity_form_mode.delete_form: path: '/admin/structure/display-modes/form/manage/{entity_form_mode}/delete' defaults: _entity_form: 'entity_form_mode.delete' diff --git a/core/modules/field_ui/src/FieldConfigListBuilder.php b/core/modules/field_ui/src/FieldConfigListBuilder.php index e6afeb2..60e0048 100644 --- a/core/modules/field_ui/src/FieldConfigListBuilder.php +++ b/core/modules/field_ui/src/FieldConfigListBuilder.php @@ -62,17 +62,17 @@ public function getDefaultOperations(EntityInterface $entity) { /** @var \Drupal\field\FieldConfigInterface $entity */ $operations = parent::getDefaultOperations($entity); - if ($entity->access('update') && $entity->hasLinkTemplate("field_ui.instance-{$entity->entity_type}-edit-form")) { + if ($entity->access('update') && $entity->hasLinkTemplate("field_ui.field-{$entity->entity_type}-edit-form")) { $operations['edit'] = array( 'title' => $this->t('Edit'), 'weight' => 10, - ) + $entity->urlInfo("field_ui.instance-{$entity->entity_type}-edit-form")->toArray(); + ) + $entity->urlInfo("field_ui.field-{$entity->entity_type}-edit-form")->toArray(); } - if ($entity->access('delete') && $entity->hasLinkTemplate("field_ui.{$entity->entity_type}-delete-form")) { + if ($entity->access('delete') && $entity->hasLinkTemplate("field_ui.field-{$entity->entity_type}-delete-form")) { $operations['delete'] = array( 'title' => $this->t('Delete'), 'weight' => 100, - ) + $entity->urlInfo("field_ui.{$entity->entity_type}-delete-form")->toArray(); + ) + $entity->urlInfo("field_ui.field-{$entity->entity_type}-delete-form")->toArray(); } $bundle = $this->entityManager->getDefinition($entity->entity_type)->getBundleEntityType(); @@ -80,7 +80,7 @@ public function getDefaultOperations(EntityInterface $entity) { 'title' => $this->t('Field settings'), 'weight' => 20, 'attributes' => array('title' => $this->t('Edit field settings.')), - ) + $entity->urlInfo('storage-edit-form')->toArray(); + ) + $entity->urlInfo("field_ui.storage-{$entity->entity_type}-edit-form")->toArray(); $operations['edit']['attributes']['title'] = $this->t('Edit instance settings.'); $operations['delete']['attributes']['title'] = $this->t('Delete instance.'); diff --git a/core/modules/field_ui/src/FieldOverview.php b/core/modules/field_ui/src/FieldOverview.php index 6945100..30d6c18 100644 --- a/core/modules/field_ui/src/FieldOverview.php +++ b/core/modules/field_ui/src/FieldOverview.php @@ -135,7 +135,7 @@ public function buildForm(array $form, FormStateInterface $form_state, $entity_t 'type' => array( '#type' => 'link', '#title' => $field_types[$field_storage->getType()]['label'], - '#route_name' => "entity.field_instance_config.field_ui.storage_{$this->entity_type}_edit_form", + '#route_name' => "entity.field_config.field_ui.storage_{$this->entity_type}_edit_form", '#route_parameters' => $route_parameters, '#options' => array('attributes' => array('title' => $this->t('Edit field settings.'))), ), @@ -410,8 +410,8 @@ public function submitForm(array &$form, FormStateInterface $form_state) { $this->bundleEntityType => $this->bundle, 'field_config' => $new_field->id(), ); + $destinations[] = array('route_name' => "entity.field_config.field_ui.storage_{$this->entity_type}_edit_form", 'route_parameters' => $route_parameters); $destinations[] = array('route_name' => "entity.field_config.field_ui.field_{$this->entity_type}_edit_form", 'route_parameters' => $route_parameters); - $destinations[] = array('route_name' => "entity.field_config.field_ui.instance_{$this->entity_type}_edit_form", 'route_parameters' => $route_parameters); // Store new field information for any additional submit handlers. $form_state->set(['fields_added', '_add_new_field'], $values['field_name']); diff --git a/core/modules/field_ui/src/Plugin/Derivative/FieldUiLocalTask.php b/core/modules/field_ui/src/Plugin/Derivative/FieldUiLocalTask.php index 6f6b5e4..754eee3 100644 --- a/core/modules/field_ui/src/Plugin/Derivative/FieldUiLocalTask.php +++ b/core/modules/field_ui/src/Plugin/Derivative/FieldUiLocalTask.php @@ -95,7 +95,7 @@ public function getDerivativeDefinitions($base_plugin_definition) { ); // Field instance edit tab. - $this->derivatives['field_edit_$field_entity_type"] = array( + $this->derivatives["field_edit_$field_entity_type"] = array( 'route_name' => "field_ui.field_edit_$field_entity_type", 'title' => $this->t('Edit'), 'base_route' => "field_ui.field_edit_$field_entity_type", diff --git a/core/modules/field_ui/src/Routing/RouteSubscriber.php b/core/modules/field_ui/src/Routing/RouteSubscriber.php index 5cddadb..eed7239 100644 --- a/core/modules/field_ui/src/Routing/RouteSubscriber.php +++ b/core/modules/field_ui/src/Routing/RouteSubscriber.php @@ -54,6 +54,9 @@ protected function alterRoutes(RouteCollection $collection) { 'type' => 'entity:' . $entity_type->getBundleEntityType(), ); } + elseif ($bundle_entity_type == 'bundle') { + $bundle_entity_type = $entity_type_id; + } $route = new Route( "$path/fields/{field_config}", @@ -72,7 +75,7 @@ protected function alterRoutes(RouteCollection $collection) { array('_entity_access' => 'field_config.update'), $options ); - $collection->add("entity.field_instance_config.field_ui.storage_{$entity_type_id}_edit_form", $route); + $collection->add("entity.field_config.field_ui.storage_{$entity_type_id}_edit_form", $route); $route = new Route( "$path/fields/{field_config}/delete", @@ -80,7 +83,7 @@ protected function alterRoutes(RouteCollection $collection) { array('_entity_access' => 'field_config.delete'), $options ); - $collection->add("entity.field_instance_config.field_ui.{$entity_type_id}_delete_form", $route); + $collection->add("entity.field_config.field_ui.field_{$entity_type_id}_delete_form", $route); // If the entity type has no bundles, use the entity type. $defaults['entity_type_id'] = $entity_type_id; diff --git a/core/modules/menu_link_content/menu_link_content.routing.yml b/core/modules/menu_link_content/menu_link_content.routing.yml index 20832e9..15516bd 100644 --- a/core/modules/menu_link_content/menu_link_content.routing.yml +++ b/core/modules/menu_link_content/menu_link_content.routing.yml @@ -14,6 +14,14 @@ entity.menu_link_content.canonical: requirements: _entity_access: 'menu_link_content.update' +entity.menu_link_content.edit_form: + path: '/admin/structure/menu/item/{menu_link_content}/edit' + defaults: + _entity_form: 'menu_link_content.default' + _title: 'Edit menu link' + requirements: + _entity_access: 'menu_link_content.update' + entity.menu_link_content.delete_form: path: '/admin/structure/menu/item/{menu_link_content}/delete' defaults: diff --git a/core/modules/menu_link_content/src/Entity/MenuLinkContent.php b/core/modules/menu_link_content/src/Entity/MenuLinkContent.php index c39d156..89f2195 100644 --- a/core/modules/menu_link_content/src/Entity/MenuLinkContent.php +++ b/core/modules/menu_link_content/src/Entity/MenuLinkContent.php @@ -41,7 +41,7 @@ * }, * links = { * "canonical" = "entity.menu_link_content.canonical", - * "edit-form" = "entity.menu_link_content.canonical", + * "edit-form" = "entity.menu_link_content.edit_form", * "delete-form" = "entity.menu_link_content.delete_form", * } * ) diff --git a/core/modules/menu_link_content/src/Plugin/Menu/MenuLinkContent.php b/core/modules/menu_link_content/src/Plugin/Menu/MenuLinkContent.php index ea47019..2d218c5 100644 --- a/core/modules/menu_link_content/src/Plugin/Menu/MenuLinkContent.php +++ b/core/modules/menu_link_content/src/Plugin/Menu/MenuLinkContent.php @@ -202,7 +202,7 @@ public function getEditRoute() { public function getTranslateRoute() { $entity_type = 'menu_link_content'; return array( - 'route_name' => 'content_translation.translation_overview_' . $entity_type, + 'route_name' => "entity.{$entity_type}.content_translation_overview", 'route_parameters' => array( $entity_type => $this->getEntity()->id()), ); }