summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlex Pott2014-08-12 18:23:01 (GMT)
committerAlex Pott2014-08-12 18:23:01 (GMT)
commitcd8986c2d70a6dca048b106a29e2d3220b0ac3f6 (patch)
tree37c46ca5dfaf146b0a6f9c60847f82f32c75866e
parent2d03e83a9ef9902167c34a6c6a8cf3e1fd7b2805 (diff)
Issue #2278567 by kgoel, azinck, dawehner | Crell: Standardize node route names by relationship.
-rw-r--r--core/lib/Drupal/Core/Entity/EntityInterface.php6
-rw-r--r--core/lib/Drupal/Core/Form/FormSubmitterInterface.php2
-rw-r--r--core/modules/book/book.admin.inc6
-rw-r--r--core/modules/book/book.links.task.yml2
-rw-r--r--core/modules/book/book.module8
-rw-r--r--core/modules/book/src/BookBreadcrumbBuilder.php2
-rw-r--r--core/modules/book/src/Form/BookOutlineForm.php2
-rw-r--r--core/modules/book/tests/src/Menu/BookLocalTasksTest.php4
-rw-r--r--core/modules/content_translation/tests/src/Menu/ContentTranslationLocalTasksTest.php20
-rw-r--r--core/modules/contextual/src/Tests/ContextualDynamicContextTest.php4
-rw-r--r--core/modules/forum/src/Breadcrumb/ForumNodeBreadcrumbBuilder.php2
-rw-r--r--core/modules/forum/tests/src/Breadcrumb/ForumNodeBreadcrumbBuilderTest.php8
-rw-r--r--core/modules/menu_link_content/src/MenuLinkContentInterface.php4
-rw-r--r--core/modules/menu_ui/menu_ui.module8
-rw-r--r--core/modules/menu_ui/src/Tests/MenuNodeTest.php4
-rw-r--r--core/modules/menu_ui/src/Tests/MenuTest.php2
-rw-r--r--core/modules/node/node.links.contextual.yml8
-rw-r--r--core/modules/node/node.links.task.yml30
-rw-r--r--core/modules/node/node.module6
-rw-r--r--core/modules/node/node.routing.yml12
-rw-r--r--core/modules/node/src/Controller/NodeController.php2
-rw-r--r--core/modules/node/src/Entity/Node.php10
-rw-r--r--core/modules/node/src/Entity/NodeType.php5
-rw-r--r--core/modules/node/src/Form/NodeRevisionDeleteForm.php6
-rw-r--r--core/modules/node/src/Form/NodeRevisionRevertForm.php4
-rw-r--r--core/modules/node/src/NodeForm.php2
-rw-r--r--core/modules/system/entity.api.php2
-rw-r--r--core/modules/system/system.api.php7
-rw-r--r--core/modules/views/src/Tests/Entity/RowEntityRenderersTest.php2
29 files changed, 90 insertions, 90 deletions
diff --git a/core/lib/Drupal/Core/Entity/EntityInterface.php b/core/lib/Drupal/Core/Entity/EntityInterface.php
index c6054a3..4399d01 100644
--- a/core/lib/Drupal/Core/Entity/EntityInterface.php
+++ b/core/lib/Drupal/Core/Entity/EntityInterface.php
@@ -103,9 +103,9 @@ interface EntityInterface extends AccessibleInterface {
* 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 15ce4d2..af9b3db 100644
--- a/core/lib/Drupal/Core/Form/FormSubmitterInterface.php
+++ b/core/lib/Drupal/Core/Form/FormSubmitterInterface.php
@@ -59,7 +59,7 @@ interface FormSubmitterInterface {
* @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 6a3edc1..469267c 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 796c5fd..2ce18c6 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 3fe7f33..ab0a5fe 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 bcdb593..9708b3d 100644
--- a/core/modules/book/src/BookBreadcrumbBuilder.php
+++ b/core/modules/book/src/BookBreadcrumbBuilder.php
@@ -87,7 +87,7 @@ class BookBreadcrumbBuilder implements BreadcrumbBuilderInterface {
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 8530fab..93140dd 100644
--- a/core/modules/book/src/Form/BookOutlineForm.php
+++ b/core/modules/book/src/Form/BookOutlineForm.php
@@ -103,7 +103,7 @@ class BookOutlineForm extends ContentEntityForm {
*/
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 fd92757..8f585fa 100644
--- a/core/modules/book/tests/src/Menu/BookLocalTasksTest.php
+++ b/core/modules/book/tests/src/Menu/BookLocalTasksTest.php
@@ -53,7 +53,7 @@ class BookLocalTasksTest extends LocalTaskIntegrationTest {
*/
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 @@ class BookLocalTasksTest extends LocalTaskIntegrationTest {
*/
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 7df4e30..2f13405 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 @@ class ContentTranslationLocalTasksTest extends LocalTaskIntegrationTest {
$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 @@ class ContentTranslationLocalTasksTest extends LocalTaskIntegrationTest {
*/
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 af16592..e107398 100644
--- a/core/modules/contextual/src/Tests/ContextualDynamicContextTest.php
+++ b/core/modules/contextual/src/Tests/ContextualDynamicContextTest.php
@@ -74,9 +74,9 @@ class ContextualDynamicContextTest extends WebTestBase {
$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 b4134d8..48d2b38 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 2cacbb0..86cad8e 100644
--- a/core/modules/forum/tests/src/Breadcrumb/ForumNodeBreadcrumbBuilderTest.php
+++ b/core/modules/forum/tests/src/Breadcrumb/ForumNodeBreadcrumbBuilderTest.php
@@ -84,20 +84,20 @@ class ForumNodeBreadcrumbBuilderTest extends UnitTestCase {
),
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 1f56715..a5d0aca 100644
--- a/core/modules/menu_link_content/src/MenuLinkContentInterface.php
+++ b/core/modules/menu_link_content/src/MenuLinkContentInterface.php
@@ -48,8 +48,8 @@ interface MenuLinkContentInterface extends ContentEntityInterface {
*
* @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 83528b5..05310a2 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 9629b2e..e08e1a8 100644
--- a/core/modules/menu_ui/src/Tests/MenuNodeTest.php
+++ b/core/modules/menu_ui/src/Tests/MenuNodeTest.php
@@ -126,7 +126,7 @@ class MenuNodeTest extends WebTestBase {
// 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 @@ class MenuNodeTest extends WebTestBase {
$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 7065506..ecec599 100644
--- a/core/modules/menu_ui/src/Tests/MenuTest.php
+++ b/core/modules/menu_ui/src/Tests/MenuTest.php
@@ -318,7 +318,7 @@ class MenuTest extends MenuWebTestBase {
$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 91159bd..f1d8a9e 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 c61ad90..88271e8 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 ba529e0..fefd6d5 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 86278f2..f9523d4 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 e40cf7e..e983eee 100644
--- a/core/modules/node/src/Controller/NodeController.php
+++ b/core/modules/node/src/Controller/NodeController.php
@@ -173,7 +173,7 @@ class NodeController extends ControllerBase implements ContainerInjectionInterfa
'#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 1cdc5c0..928976b 100644
--- a/core/modules/node/src/Entity/Node.php
+++ b/core/modules/node/src/Entity/Node.php
@@ -51,11 +51,11 @@ use Drupal\user\UserInterface;
* 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 91ce4f7..57fc6f6 100644
--- a/core/modules/node/src/Entity/NodeType.php
+++ b/core/modules/node/src/Entity/NodeType.php
@@ -35,9 +35,8 @@ use Drupal\node\NodeTypeInterface;
* "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 dbbe550..352cef0 100644
--- a/core/modules/node/src/Form/NodeRevisionDeleteForm.php
+++ b/core/modules/node/src/Form/NodeRevisionDeleteForm.php
@@ -94,7 +94,7 @@ class NodeRevisionDeleteForm extends ConfirmFormBase {
* {@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 @@ class NodeRevisionDeleteForm extends ConfirmFormBase {
$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 bc5a302..d6e748e 100644
--- a/core/modules/node/src/Form/NodeRevisionRevertForm.php
+++ b/core/modules/node/src/Form/NodeRevisionRevertForm.php
@@ -70,7 +70,7 @@ class NodeRevisionRevertForm extends ConfirmFormBase {
* {@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 @@ class NodeRevisionRevertForm extends ConfirmFormBase {
$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 0965b16..a2ec826 100644
--- a/core/modules/node/src/NodeForm.php
+++ b/core/modules/node/src/NodeForm.php
@@ -450,7 +450,7 @@ class NodeForm extends ContentEntityForm {
$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 734814e..dcfc314 100644
--- a/core/modules/system/entity.api.php
+++ b/core/modules/system/entity.api.php
@@ -319,7 +319,7 @@ use Drupal\Core\Render\Element;
* 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 57a2e24..3d52bbd 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 8eb006d..c0f3a05 100644
--- a/core/modules/views/src/Tests/Entity/RowEntityRenderersTest.php
+++ b/core/modules/views/src/Tests/Entity/RowEntityRenderersTest.php
@@ -51,7 +51,7 @@ class RowEntityRenderersTest extends ViewUnitTestBase {
$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);