diff --git a/core/lib/Drupal/Core/Entity/EntityInterface.php b/core/lib/Drupal/Core/Entity/EntityInterface.php index c6054a343880e0fa552fc03173165a20be3144ce..4399d01d2b3a40f35100106f45f1890cdc833412 100644 --- a/core/lib/Drupal/Core/Entity/EntityInterface.php +++ b/core/lib/Drupal/Core/Entity/EntityInterface.php @@ -103,9 +103,9 @@ public function label(); * example: * @code * links = { - * "canonical" = "node.view", - * "edit-form" = "node.page_edit", - * "version-history" = "node.revision_overview" + * "canonical" = "entity.node.canonical", + * "edit-form" = "entity.node.edit_form", + * "version-history" = "entity.node.version_history" * } * @endcode * or specified in a callback function set like: diff --git a/core/lib/Drupal/Core/Form/FormSubmitterInterface.php b/core/lib/Drupal/Core/Form/FormSubmitterInterface.php index 15ce4d212462e0bc0187896912cfbdcfd33e9208..af9b3db52ee67225efb0aa12d622b0fe41e6b076 100644 --- a/core/lib/Drupal/Core/Form/FormSubmitterInterface.php +++ b/core/lib/Drupal/Core/Form/FormSubmitterInterface.php @@ -59,7 +59,7 @@ public function executeSubmitHandlers(&$form, FormStateInterface &$form_state); * @endcode * And here is an example of how to redirect to 'node/123?foo=bar#baz': * @code - * $form_state->setRedirect('node.view', + * $form_state->setRedirect('entity.node.canonical', * array('node' => 123), * array( * 'query' => array( diff --git a/core/modules/book/book.admin.inc b/core/modules/book/book.admin.inc index 6a3edc16f528d9261d1f9cfcd2ac9cfcf5da1e1a..469267c99dd8b844050fdffd1b4ed44a6d82f347 100644 --- a/core/modules/book/book.admin.inc +++ b/core/modules/book/book.admin.inc @@ -29,7 +29,7 @@ function theme_book_admin_table($variables) { $access = \Drupal::currentUser()->hasPermission('administer nodes'); foreach (Element::children($form) as $key) { $nid = $form[$key]['nid']['#value']; - $href = \Drupal::url('node.view', array('node' => $nid)); + $href = \Drupal::url('entity.node.canonical', array('node' => $nid)); // Add special classes to be used with tabledrag.js. $form[$key]['pid']['#attributes']['class'] = array('book-pid'); @@ -50,13 +50,13 @@ function theme_book_admin_table($variables) { if ($access) { $links['edit'] = array( 'title' => t('Edit'), - 'route_name' => 'node.page_edit', + 'route_name' => 'entity.node.edit_form', 'route_parameters' => array('node' => $nid), 'query' => $destination, ); $links['delete'] = array( 'title' => t('Delete'), - 'route_name' => 'node.delete_confirm', + 'route_name' => 'entity.node.delete_form', 'route_parameters' => array('node' => $nid), 'query' => $destination, ); diff --git a/core/modules/book/book.links.task.yml b/core/modules/book/book.links.task.yml index 796c5fda0f63c10d0b94d891421014e70f15d4d8..2ce18c6bc6d0acc98679032855b20abf13076f43 100644 --- a/core/modules/book/book.links.task.yml +++ b/core/modules/book/book.links.task.yml @@ -10,6 +10,6 @@ book.settings: book.outline: route_name: book.outline - base_route: node.view + base_route: entity.node.canonical title: Outline weight: 2 diff --git a/core/modules/book/book.module b/core/modules/book/book.module index 3fe7f33594d13bee6bfe12d18d87e88128b14ab0..ab0a5fe33e1b9d301bf3af01b19143efd7a227cc 100644 --- a/core/modules/book/book.module +++ b/core/modules/book/book.module @@ -406,7 +406,7 @@ function template_preprocess_book_navigation(&$variables) { // Provide extra variables for themers. Not needed by default. $variables['book_id'] = $book_link['bid']; $variables['book_title'] = String::checkPlain($book_link['link_title']); - $variables['book_url'] = \Drupal::url('node.view', array('node' => $book_link['bid'])); + $variables['book_url'] = \Drupal::url('entity.node.canonical', array('node' => $book_link['bid'])); $variables['current_depth'] = $book_link['depth']; $variables['tree'] = ''; @@ -419,7 +419,7 @@ function template_preprocess_book_navigation(&$variables) { $build = array(); if ($prev = $book_outline->prevLink($book_link)) { - $prev_href = \Drupal::url('node.view', array('node' => $prev['nid'])); + $prev_href = \Drupal::url('entity.node.canonical', array('node' => $prev['nid'])); $build['#attached']['drupal_add_html_head_link'][][] = array( 'rel' => 'prev', 'href' => $prev_href, @@ -431,7 +431,7 @@ function template_preprocess_book_navigation(&$variables) { /** @var \Drupal\book\BookManagerInterface $book_manager */ $book_manager = \Drupal::service('book.manager'); if ($book_link['pid'] && $parent = $book_manager->loadBookLink($book_link['pid'])) { - $parent_href = \Drupal::url('node.view', array('node' => $book_link['pid'])); + $parent_href = \Drupal::url('entity.node.canonical', array('node' => $book_link['pid'])); $build['#attached']['drupal_add_html_head_link'][][] = array( 'rel' => 'up', 'href' => $parent_href, @@ -441,7 +441,7 @@ function template_preprocess_book_navigation(&$variables) { } if ($next = $book_outline->nextLink($book_link)) { - $next_href = \Drupal::url('node.view', array('node' => $next['nid'])); + $next_href = \Drupal::url('entity.node.canonical', array('node' => $next['nid'])); $build['#attached']['drupal_add_html_head_link'][][] = array( 'rel' => 'next', 'href' => $next_href, diff --git a/core/modules/book/src/BookBreadcrumbBuilder.php b/core/modules/book/src/BookBreadcrumbBuilder.php index bcdb593a80d57e8cb7b19289839e7aa3bc790b0e..9708b3de74e7276c8b2491d1ee5cf3a0236aac52 100644 --- a/core/modules/book/src/BookBreadcrumbBuilder.php +++ b/core/modules/book/src/BookBreadcrumbBuilder.php @@ -87,7 +87,7 @@ public function build(RouteMatchInterface $route_match) { while (!empty($book['p' . ($depth + 1)])) { if (!empty($parent_books[$book['p' . $depth]]) && ($parent_book = $parent_books[$book['p' . $depth]])) { if ($parent_book->access('view', $this->account)) { - $links[] = $this->l($parent_book->label(), 'node.view', array('node' => $parent_book->id())); + $links[] = $this->l($parent_book->label(), 'entity.node.canonical', array('node' => $parent_book->id())); } } $depth++; diff --git a/core/modules/book/src/Form/BookOutlineForm.php b/core/modules/book/src/Form/BookOutlineForm.php index 8530fab254f16149d652d7a7a2c42a7ed7b02b39..93140dd16305c1b3fa90801b37dba7a7dadadac9 100644 --- a/core/modules/book/src/Form/BookOutlineForm.php +++ b/core/modules/book/src/Form/BookOutlineForm.php @@ -103,7 +103,7 @@ protected function actions(array $form, FormStateInterface $form_state) { */ public function submit(array $form, FormStateInterface $form_state) { $form_state->setRedirect( - 'node.view', + 'entity.node.canonical', array('node' => $this->entity->id()) ); $book_link = $form_state->getValue('book'); diff --git a/core/modules/book/tests/src/Menu/BookLocalTasksTest.php b/core/modules/book/tests/src/Menu/BookLocalTasksTest.php index fd9275788f6cf2947c30f012022e6d8750c47dec..8f585facd7324e4e13a7a70c36359f72a643d6e2 100644 --- a/core/modules/book/tests/src/Menu/BookLocalTasksTest.php +++ b/core/modules/book/tests/src/Menu/BookLocalTasksTest.php @@ -53,7 +53,7 @@ public function getBookAdminRoutes() { */ public function testBookNodeLocalTasks($route) { $this->assertLocalTasks($route, array( - 0 => array('book.outline', 'node.view', 'node.page_edit', 'node.delete_confirm', 'node.revision_overview',), + 0 => array('book.outline', 'entity.node.canonical', 'entity.node.edit_form', 'entity.node.delete_form', 'entity.node.version_history',), )); } @@ -62,7 +62,7 @@ public function testBookNodeLocalTasks($route) { */ public function getBookNodeRoutes() { return array( - array('node.view'), + array('entity.node.canonical'), array('book.outline'), ); } diff --git a/core/modules/content_translation/tests/src/Menu/ContentTranslationLocalTasksTest.php b/core/modules/content_translation/tests/src/Menu/ContentTranslationLocalTasksTest.php index 7df4e30a49363492059618ea30707d33a2b6efd8..2f134057618d7a9c4ed2683c29d916ec6db16148 100644 --- a/core/modules/content_translation/tests/src/Menu/ContentTranslationLocalTasksTest.php +++ b/core/modules/content_translation/tests/src/Menu/ContentTranslationLocalTasksTest.php @@ -27,7 +27,7 @@ public function setUp() { $entity_type->expects($this->any()) ->method('getLinkTemplate') ->will($this->returnValueMap(array( - array('canonical', 'node.view'), + array('canonical', 'entity.node.canonical'), array('drupal:content-translation-overview', 'content_translation.translation_overview_node'), ))); $content_translation_manager = $this->getMock('Drupal\content_translation\ContentTranslationManagerInterface'); @@ -53,19 +53,19 @@ public function testBlockAdminDisplay($route, $expected) { */ public function providerTestBlockAdminDisplay() { return array( - array('node.view', array(array( + array('entity.node.canonical', array(array( 'content_translation.local_tasks:content_translation.translation_overview_node', - 'node.view', - 'node.page_edit', - 'node.delete_confirm', - 'node.revision_overview', + 'entity.node.canonical', + 'entity.node.edit_form', + 'entity.node.delete_form', + 'entity.node.version_history', ))), array('content_translation.translation_overview_node', array(array( 'content_translation.local_tasks:content_translation.translation_overview_node', - 'node.view', - 'node.page_edit', - 'node.delete_confirm', - 'node.revision_overview', + 'entity.node.canonical', + 'entity.node.edit_form', + 'entity.node.delete_form', + 'entity.node.version_history', ))), ); } diff --git a/core/modules/contextual/src/Tests/ContextualDynamicContextTest.php b/core/modules/contextual/src/Tests/ContextualDynamicContextTest.php index af16592167c8fb3518e9a03e55ce2d14e403d0f9..e1073989ed8e069a4809c61e8dc8232f8ea0813b 100644 --- a/core/modules/contextual/src/Tests/ContextualDynamicContextTest.php +++ b/core/modules/contextual/src/Tests/ContextualDynamicContextTest.php @@ -74,9 +74,9 @@ function testDifferentPermissions() { $response = $this->renderContextualLinks($ids, 'node'); $this->assertResponse(200); $json = Json::decode($response); - $this->assertIdentical($json[$ids[0]], '<ul class="contextual-links"><li class="nodepage-edit"><a href="' . base_path() . 'node/1/edit">Edit</a></li></ul>'); + $this->assertIdentical($json[$ids[0]], '<ul class="contextual-links"><li class="entitynodeedit-form"><a href="' . base_path() . 'node/1/edit">Edit</a></li></ul>'); $this->assertIdentical($json[$ids[1]], ''); - $this->assertIdentical($json[$ids[2]], '<ul class="contextual-links"><li class="nodepage-edit"><a href="' . base_path() . 'node/3/edit">Edit</a></li></ul>'); + $this->assertIdentical($json[$ids[2]], '<ul class="contextual-links"><li class="entitynodeedit-form"><a href="' . base_path() . 'node/3/edit">Edit</a></li></ul>'); $this->assertIdentical($json[$ids[3]], ''); // Authenticated user: can access contextual links, cannot edit articles. diff --git a/core/modules/forum/src/Breadcrumb/ForumNodeBreadcrumbBuilder.php b/core/modules/forum/src/Breadcrumb/ForumNodeBreadcrumbBuilder.php index b4134d824dcef844bd51a6f2e6744a5799cf5d9c..48d2b3848eeaf459b471fed1c575eab75837c30d 100644 --- a/core/modules/forum/src/Breadcrumb/ForumNodeBreadcrumbBuilder.php +++ b/core/modules/forum/src/Breadcrumb/ForumNodeBreadcrumbBuilder.php @@ -18,7 +18,7 @@ class ForumNodeBreadcrumbBuilder extends ForumBreadcrumbBuilderBase { * {@inheritdoc} */ public function applies(RouteMatchInterface $route_match) { - return $route_match->getRouteName() == 'node.view' + return $route_match->getRouteName() == 'entity.node.canonical' && $route_match->getParameter('node') && $this->forumManager->checkNodeType($route_match->getParameter('node')); } diff --git a/core/modules/forum/tests/src/Breadcrumb/ForumNodeBreadcrumbBuilderTest.php b/core/modules/forum/tests/src/Breadcrumb/ForumNodeBreadcrumbBuilderTest.php index 2cacbb011a00d0d56890f1ed9fb526a4715ca7ae..86cad8ed6d75bab63cfd1b1597678c4fe34a71c5 100644 --- a/core/modules/forum/tests/src/Breadcrumb/ForumNodeBreadcrumbBuilderTest.php +++ b/core/modules/forum/tests/src/Breadcrumb/ForumNodeBreadcrumbBuilderTest.php @@ -84,20 +84,20 @@ public function providerTestApplies() { ), array( FALSE, - 'NOT.node.view', + 'NOT.entity.node.canonical', ), array( FALSE, - 'node.view', + 'entity.node.canonical', ), array( FALSE, - 'node.view', + 'entity.node.canonical', array(array('node', NULL)), ), array( TRUE, - 'node.view', + 'entity.node.canonical', array(array('node', $mock_node)), ), ); diff --git a/core/modules/menu_link_content/src/MenuLinkContentInterface.php b/core/modules/menu_link_content/src/MenuLinkContentInterface.php index 1f567153aa2acfc2ada25f3ddad6464e7e80f12a..a5d0aca449757140636b9a32a646d087536c9e94 100644 --- a/core/modules/menu_link_content/src/MenuLinkContentInterface.php +++ b/core/modules/menu_link_content/src/MenuLinkContentInterface.php @@ -48,8 +48,8 @@ public function getRouteParameters(); * * @param array $route_parameters * The route parameters, usually derived from the path entered by the - * administrator. For example, for a link to a node with route 'node.view' - * the route needs the node ID as a parameter: + * administrator. For example, for a link to a node with route + * 'entity.node.canonical' the route needs the node ID as a parameter: * @code * array('node' => 2) * @endcode diff --git a/core/modules/menu_ui/menu_ui.module b/core/modules/menu_ui/menu_ui.module index 83528b5195a57fb41f24e17eb887078737313e49..05310a2c32050c1c859e6f321819a83ebb91b2d1 100644 --- a/core/modules/menu_ui/menu_ui.module +++ b/core/modules/menu_ui/menu_ui.module @@ -209,7 +209,7 @@ function menu_ui_node_save(EntityInterface $node) { $entity = entity_create('menu_link_content', array( 'title' => trim($definition['title']), 'description' => trim($definition['description']), - 'route_name' => 'node.view', + 'route_name' => 'entity.node.canonical', 'route_parameters' => array('node' => $node->id()), 'menu_name' => $definition['menu_name'], 'parent' => $definition['parent'], @@ -233,7 +233,7 @@ function menu_ui_node_predelete(EntityInterface $node) { // Delete all MenuLinkContent links that point to this node. /** @var \Drupal\Core\Menu\MenuLinkManagerInterface $menu_link_manager */ $menu_link_manager = \Drupal::service('plugin.manager.menu.link'); - $result = $menu_link_manager->loadLinksByRoute('node.view', array('node' => $node->id())); + $result = $menu_link_manager->loadLinksByRoute('entity.node.canonical', array('node' => $node->id())); if (!empty($result)) { foreach ($result as $id => $instance) { @@ -259,7 +259,7 @@ function menu_ui_node_prepare_form(NodeInterface $node, $operation, FormStateInt $type_menus = $node_type_config->get('available_menus'); if (in_array($menu_name, $type_menus)) { $query = \Drupal::entityQuery('menu_link_content') - ->condition('route_name', 'node.view') + ->condition('route_name', 'entity.node.canonical') ->condition('route_parameters', serialize(array('node' => $node->id()))) ->condition('menu_name', $menu_name) ->sort('id', 'ASC') @@ -271,7 +271,7 @@ function menu_ui_node_prepare_form(NodeInterface $node, $operation, FormStateInt // Check all allowed menus if a link does not exist in the default menu. if (!$id && !empty($type_menus)) { $query = \Drupal::entityQuery('menu_link_content') - ->condition('route_name', 'node.view') + ->condition('route_name', 'entity.node.canonical') ->condition('route_parameters', serialize(array('node' => $node->id()))) ->condition('menu_name', array_values($type_menus), 'IN') ->sort('id', 'ASC') diff --git a/core/modules/menu_ui/src/Tests/MenuNodeTest.php b/core/modules/menu_ui/src/Tests/MenuNodeTest.php index 9629b2e66efe832f980c06f6df2c20e6ba58f5b6..e08e1a8d4dc7ca1b9c924a158deb1b8a59fd3239 100644 --- a/core/modules/menu_ui/src/Tests/MenuNodeTest.php +++ b/core/modules/menu_ui/src/Tests/MenuNodeTest.php @@ -126,7 +126,7 @@ function testMenuNodeFormWidget() { // Add a menu link to the Administration menu. $item = entity_create('menu_link_content', array( - 'route_name' => 'node.view', + 'route_name' => 'entity.node.canonical', 'route_parameters' => array('node' => $node->id()), 'title' => $this->randomMachineName(16), 'menu_name' => 'admin', @@ -150,7 +150,7 @@ function testMenuNodeFormWidget() { $child_node = $this->drupalCreateNode(array('type' => 'article')); // Assign a menu link to the second node, being a child of the first one. $child_item = entity_create('menu_link_content', array( - 'route_name' => 'node.view', + 'route_name' => 'entity.node.canonical', 'route_parameters' => array('node' => $child_node->id()), 'title' => $this->randomMachineName(16), 'parent' => $item->getPluginId(), diff --git a/core/modules/menu_ui/src/Tests/MenuTest.php b/core/modules/menu_ui/src/Tests/MenuTest.php index 70655061aeee8dd3c85b9215d6f1ba845d14e84a..ecec599ed518b17af8eaa392056e012589db749f 100644 --- a/core/modules/menu_ui/src/Tests/MenuTest.php +++ b/core/modules/menu_ui/src/Tests/MenuTest.php @@ -318,7 +318,7 @@ function doMenuTests() { $this->assertMenuLink($item6->getPluginId(), array( 'children' => array(), 'parents' => array($item6->getPluginId(), $item4->getPluginId()), - 'route_name' => 'node.view', + 'route_name' => 'entity.node.canonical', 'route_parameters' => array('node' => $node5->id()), 'url' => '', // See above. diff --git a/core/modules/node/node.links.contextual.yml b/core/modules/node/node.links.contextual.yml index 91159bdc75aa46ebf907b875df66591ebd75f4cf..f1d8a9eec87ae72335dab443679b14a2e290049b 100644 --- a/core/modules/node/node.links.contextual.yml +++ b/core/modules/node/node.links.contextual.yml @@ -1,10 +1,10 @@ -node.page_edit: - route_name: node.page_edit +entity.node.edit_form: + route_name: entity.node.edit_form group: node title: Edit -node.delete_confirm: - route_name: node.delete_confirm +entity.node.delete_form: + route_name: entity.node.delete_form group: node title: Delete weight: 10 diff --git a/core/modules/node/node.links.task.yml b/core/modules/node/node.links.task.yml index c61ad9064eacca946edfbea09e4371542c554098..88271e884a4c2b57bdfa6afaa9a5b05ad6652811 100644 --- a/core/modules/node/node.links.task.yml +++ b/core/modules/node/node.links.task.yml @@ -1,25 +1,25 @@ -node.view: - route_name: node.view - base_route: node.view +entity.node.canonical: + route_name: entity.node.canonical + base_route: entity.node.canonical title: 'View' -node.page_edit: - route_name: node.page_edit - base_route: node.view +entity.node.edit_form: + route_name: entity.node.edit_form + base_route: entity.node.canonical title: Edit -node.delete_confirm: - route_name: node.delete_confirm - base_route: node.view +entity.node.delete_form: + route_name: entity.node.delete_form + base_route: entity.node.canonical title: Delete weight: 10 -node.revision_overview: - route_name: node.revision_overview - base_route: node.view +entity.node.version_history: + route_name: entity.node.version_history + base_route: entity.node.canonical title: 'Revisions' weight: 20 -node.type_edit: +entity.node_type.edit_form: title: 'Edit' - route_name: node.type_edit - base_route: node.type_edit + route_name: entity.node_type.edit_form + base_route: entity.node_type.edit_form node.overview_types: title: List route_name: node.overview_types diff --git a/core/modules/node/node.module b/core/modules/node/node.module index ba529e0c7f36efb9f7840caeb7bfe1ccca538312..fefd6d5c9a13fb93d0a7393906ef4c2c79ed4a62 100644 --- a/core/modules/node/node.module +++ b/core/modules/node/node.module @@ -138,10 +138,10 @@ function node_help($route_name, RouteMatchInterface $route_match) { return '<p>' . t('Content items can be displayed using different view modes: Teaser, Full content, Print, RSS, etc. <em>Teaser</em> is a short format that is typically used in lists of multiple content items. <em>Full content</em> is typically used when the content is displayed on its own page.') . '</p>' . '<p>' . t('Here, you can define which fields are shown and hidden when %type content is displayed in each view mode, and define how the fields are displayed in each view mode.', array('%type' => $type->label())) . '</p>'; - case 'node.revision_overview': + case 'entity.node.version_history': return '<p>' . t('Revisions allow you to track differences between multiple versions of your content, and revert back to older versions.') . '</p>'; - case 'node.page_edit': + case 'entity.node.edit_form': $node = $route_match->getParameter('node'); $type = $node->getType(); return (!empty($type->help) ? Xss::filterAdmin($type->help) : ''); @@ -545,7 +545,7 @@ function node_revision_delete($revision_id) { */ function node_is_page(NodeInterface $node) { $route_match = \Drupal::routeMatch(); - if ($route_match->getRouteName() == 'node.view') { + if ($route_match->getRouteName() == 'entity.node.canonical') { $page_node = $route_match->getParameter('node'); } return (!empty($page_node) ? $page_node->id() == $node->id() : FALSE); diff --git a/core/modules/node/node.routing.yml b/core/modules/node/node.routing.yml index 86278f2afff6b0a5f26ee445f1b5a1070ff98417..f9523d4c89ae4949a99322a81722e48fe815719a 100644 --- a/core/modules/node/node.routing.yml +++ b/core/modules/node/node.routing.yml @@ -6,7 +6,7 @@ node.multiple_delete_confirm: requirements: _permission: 'administer nodes' -node.page_edit: +entity.node.edit_form: path: '/node/{node}/edit' defaults: _entity_form: 'node.edit' @@ -37,7 +37,7 @@ node.add: options: _node_operation_route: TRUE -node.view: +entity.node.canonical: path: '/node/{node}' defaults: _content: '\Drupal\node\Controller\NodeViewController::view' @@ -45,7 +45,7 @@ node.view: requirements: _entity_access: 'node.view' -node.delete_confirm: +entity.node.delete_form: path: '/node/{node}/delete' defaults: _entity_form: 'node.delete' @@ -55,7 +55,7 @@ node.delete_confirm: options: _node_operation_route: TRUE -node.revision_overview: +entity.node.version_history: path: '/node/{node}/revisions' defaults: _title: 'Revisions' @@ -110,14 +110,14 @@ node.type_add: requirements: _permission: 'administer content types' -node.type_edit: +entity.node_type.edit_form: path: '/admin/structure/types/manage/{node_type}' defaults: _entity_form: 'node_type.edit' requirements: _permission: 'administer content types' -node.type_delete_confirm: +entity.node_type.delete_form: path: '/admin/structure/types/manage/{node_type}/delete' defaults: _entity_form: 'node_type.delete' diff --git a/core/modules/node/src/Controller/NodeController.php b/core/modules/node/src/Controller/NodeController.php index e40cf7ea80b5ac306b09428c51363adb7268b515..e983eee318beaf09c1839f1dc4bec4e3beed4ff4 100644 --- a/core/modules/node/src/Controller/NodeController.php +++ b/core/modules/node/src/Controller/NodeController.php @@ -173,7 +173,7 @@ public function revisionOverview(NodeInterface $node) { '#theme' => 'username', '#account' => $revision_author, ); - $row[] = array('data' => $this->t('!date by !username', array('!date' => $this->l($this->dateFormatter->format($revision->revision_timestamp->value, 'short'), 'node.view', array('node' => $node->id())), '!username' => drupal_render($username))) + $row[] = array('data' => $this->t('!date by !username', array('!date' => $this->l($this->dateFormatter->format($revision->revision_timestamp->value, 'short'), 'entity.node.canonical', array('node' => $node->id())), '!username' => drupal_render($username))) . (($revision->revision_log->value != '') ? '<p class="revision-log">' . Xss::filter($revision->revision_log->value) . '</p>' : ''), 'class' => array('revision-current')); $row[] = array('data' => String::placeholder($this->t('current revision')), 'class' => array('revision-current')); diff --git a/core/modules/node/src/Entity/Node.php b/core/modules/node/src/Entity/Node.php index 1cdc5c058b9fd78e0e995445c34d7a5118e06b9e..928976bd9f24b73ee8d553a513bcfa23c67a8885 100644 --- a/core/modules/node/src/Entity/Node.php +++ b/core/modules/node/src/Entity/Node.php @@ -51,11 +51,11 @@ * bundle_entity_type = "node_type", * permission_granularity = "bundle", * links = { - * "canonical" = "node.view", - * "delete-form" = "node.delete_confirm", - * "edit-form" = "node.page_edit", - * "version-history" = "node.revision_overview", - * "admin-form" = "node.type_edit" + * "canonical" = "entity.node.canonical", + * "delete-form" = "entity.node.delete_form", + * "edit-form" = "entity.node.edit_form", + * "version-history" = "entity.node.version_history", + * "admin-form" = "entity.node_type.edit_form" * } * ) */ diff --git a/core/modules/node/src/Entity/NodeType.php b/core/modules/node/src/Entity/NodeType.php index 91ce4f7afa05fa820afa1c22dd6a3a6cec9e5457..57fc6f665a641fdbefc1c2185207f8adf6f2e432 100644 --- a/core/modules/node/src/Entity/NodeType.php +++ b/core/modules/node/src/Entity/NodeType.php @@ -35,9 +35,8 @@ * "label" = "name" * }, * links = { - * "add-form" = "node.add", - * "edit-form" = "node.type_edit", - * "delete-form" = "node.type_delete_confirm" + * "edit-form" = "entity.node_type.edit_form", + * "delete-form" = "entity.node_type.delete_form" * } * ) */ diff --git a/core/modules/node/src/Form/NodeRevisionDeleteForm.php b/core/modules/node/src/Form/NodeRevisionDeleteForm.php index dbbe55038d3770cf2f68a8237e6fbfedc883b121..352cef0bfad50b011c0ce4991593bed475f436f5 100644 --- a/core/modules/node/src/Form/NodeRevisionDeleteForm.php +++ b/core/modules/node/src/Form/NodeRevisionDeleteForm.php @@ -94,7 +94,7 @@ public function getQuestion() { * {@inheritdoc} */ public function getCancelUrl() { - return new Url('node.revision_overview', array('node' => $this->revision->id())); + return new Url('entity.node.version_history', array('node' => $this->revision->id())); } /** @@ -124,12 +124,12 @@ public function submitForm(array &$form, FormStateInterface $form_state) { $node_type = $this->nodeTypeStorage->load($this->revision->bundle())->label(); drupal_set_message(t('Revision from %revision-date of @type %title has been deleted.', array('%revision-date' => format_date($this->revision->getRevisionCreationTime()), '@type' => $node_type, '%title' => $this->revision->label()))); $form_state->setRedirect( - 'node.view', + 'entity.node.canonical', array('node' => $this->revision->id()) ); if ($this->connection->query('SELECT COUNT(DISTINCT vid) FROM {node_field_revision} WHERE nid = :nid', array(':nid' => $this->revision->id()))->fetchField() > 1) { $form_state->setRedirect( - 'node.revision_overview', + 'entity.node.version_history', array('node' => $this->revision->id()) ); } diff --git a/core/modules/node/src/Form/NodeRevisionRevertForm.php b/core/modules/node/src/Form/NodeRevisionRevertForm.php index bc5a3023ee61a34f77f0f3ccac9e1596e585c015..d6e748e42f88ba792db6d218d6214c2f2c7d9be6 100644 --- a/core/modules/node/src/Form/NodeRevisionRevertForm.php +++ b/core/modules/node/src/Form/NodeRevisionRevertForm.php @@ -70,7 +70,7 @@ public function getQuestion() { * {@inheritdoc} */ public function getCancelUrl() { - return new Url('node.revision_overview', array('node' => $this->revision->id())); + return new Url('entity.node.version_history', array('node' => $this->revision->id())); } /** @@ -116,7 +116,7 @@ public function submitForm(array &$form, FormStateInterface $form_state) { $this->logger('content')->notice('@type: reverted %title revision %revision.', array('@type' => $this->revision->bundle(), '%title' => $this->revision->label(), '%revision' => $this->revision->getRevisionId())); drupal_set_message(t('@type %title has been reverted back to the revision from %revision-date.', array('@type' => node_get_type_label($this->revision), '%title' => $this->revision->label(), '%revision-date' => format_date($original_revision_timestamp)))); $form_state->setRedirect( - 'node.revision_overview', + 'entity.node.version_history', array('node' => $this->revision->id()) ); } diff --git a/core/modules/node/src/NodeForm.php b/core/modules/node/src/NodeForm.php index 0965b16229bb0ea825a396a31c982fccd119c4e3..a2ec826928969dade2cfc4d497633633489f1826 100644 --- a/core/modules/node/src/NodeForm.php +++ b/core/modules/node/src/NodeForm.php @@ -450,7 +450,7 @@ public function save(array $form, FormStateInterface $form_state) { $form_state['nid'] = $node->id(); if ($node->access('view')) { $form_state->setRedirect( - 'node.view', + 'entity.node.canonical', array('node' => $node->id()) ); } diff --git a/core/modules/system/entity.api.php b/core/modules/system/entity.api.php index 734814e4462e6120a00070ce1dc27c1684eafeda..dcfc314779d3d5f05746c16382b2f15398288f0d 100644 --- a/core/modules/system/entity.api.php +++ b/core/modules/system/entity.api.php @@ -319,7 +319,7 @@ * entity interface you have defined as its parameter, and returns routing * information for the entity page; see node_uri() for an example. You will * also need to add a corresponding route to your module's routing.yml file; - * see the node.view route in node.routing.yml for an example, and see + * see the entity.node.canonical route in node.routing.yml for an example, and see * @ref sec_routes below for some notes. * - Define routing and links for the various URLs associated with the entity. * These go into the 'links' annotation, with the link type as the key, and diff --git a/core/modules/system/system.api.php b/core/modules/system/system.api.php index 57a2e24ba6bf3b9f0fe01068b97353d1e73963f0..3d52bbdd598146435310be9a9811663b5dce5daa 100644 --- a/core/modules/system/system.api.php +++ b/core/modules/system/system.api.php @@ -411,9 +411,10 @@ function hook_page_build(&$page) { * patten is the route name followed by a dot and a unique suffix. For * example, an additional logout link might have a machine name of * user.logout.navigation, and default links provided to edit the article and - * page content types could use machine names node.type_edit.article and - * node.type_edit.page. Since the machine name may be arbitrary, you should - * never write code that assumes it is identical to the route name. + * page content types could use machine names + * entity.node_type.edit_form.article and entity.node_type.edit_form.page. + * Since the machine name may be arbitrary, you should never write code that + * assumes it is identical to the route name. * * The value corresponding to each machine name key is an associative array * that may contain the following key-value pairs: diff --git a/core/modules/views/src/Tests/Entity/RowEntityRenderersTest.php b/core/modules/views/src/Tests/Entity/RowEntityRenderersTest.php index 8eb006d0bc476a9933e69f990485dddcdc30e363..c0f3a05b8f2254af2c525f58fee0d020e36ff21d 100644 --- a/core/modules/views/src/Tests/Entity/RowEntityRenderersTest.php +++ b/core/modules/views/src/Tests/Entity/RowEntityRenderersTest.php @@ -51,7 +51,7 @@ protected function setUp() { $this->installSchema('node', array('node_access')); $this->installConfig(array('node', 'language')); - // The node.view route must exist when nodes are rendered. + // The entity.node.canonical route must exist when nodes are rendered. $this->container->get('router.builder')->rebuild(); $this->langcodes = array(\Drupal::languageManager()->getDefaultLanguage()->id);