diff --git a/core/modules/node/src/Plugin/views/field/RevisionLink.php b/core/modules/node/src/Plugin/views/field/RevisionLink.php index 7ba8342..fb01a19 100644 --- a/core/modules/node/src/Plugin/views/field/RevisionLink.php +++ b/core/modules/node/src/Plugin/views/field/RevisionLink.php @@ -7,14 +7,14 @@ namespace Drupal\node\Plugin\views\field; -use Drupal\node\Plugin\views\field\Link; -use Drupal\views\Plugin\views\display\DisplayPluginBase; -use Drupal\views\ResultRow; -use Drupal\views\ViewExecutable; use Drupal\Core\Database\Connection; use Drupal\Core\Entity\EntityManager; use Drupal\Core\Plugin\ContainerFactoryPluginInterface; use Drupal\Core\Session\AccountInterface; +use Drupal\node\Plugin\views\field\Link; +use Drupal\views\Plugin\views\display\DisplayPluginBase; +use Drupal\views\ResultRow; +use Drupal\views\ViewExecutable; use Symfony\Component\DependencyInjection\ContainerInterface; /** @@ -133,7 +133,8 @@ protected function renderLink($data, ResultRow $values) { list($node, , $vid) = $this->getRevisionEntity($values, 'view'); // Current revision uses the node view path. - $path = $node->getSystemPath(); + /** @var \Drupal\node\NodeInterface $node */ + $path = $node->urlInfo(); if ($this->countRevisions[$node->id()] > 1 && $node->getRevisionId() != $vid) { $path .= "/revisions/$vid/view"; } diff --git a/core/modules/node/src/Plugin/views/field/RevisionLinkDelete.php b/core/modules/node/src/Plugin/views/field/RevisionLinkDelete.php index 826bc4a..12e637f 100644 --- a/core/modules/node/src/Plugin/views/field/RevisionLinkDelete.php +++ b/core/modules/node/src/Plugin/views/field/RevisionLinkDelete.php @@ -7,7 +7,6 @@ namespace Drupal\node\Plugin\views\field; -use Drupal\Core\Session\AccountInterface; use Drupal\node\Plugin\views\field\RevisionLink; use Drupal\views\ResultRow; @@ -38,6 +37,7 @@ class RevisionLinkDelete extends RevisionLink { protected function renderLink($data, ResultRow $values) { list($node, $revision_node, $vid) = $this->getRevisionEntity($values, 'update'); + /** @var \Drupal\node\NodeInterface $node */ $type = $node->getType(); if (!(($this->currentUser->hasPermission("delete $type revisions") || $this->currentUser->hasPermission('delete all revisions') || $this->currentUser->hasPermission('administer nodes')) && $revision_node->access('delete'))) { return; diff --git a/core/modules/node/src/Plugin/views/field/RevisionLinkRevert.php b/core/modules/node/src/Plugin/views/field/RevisionLinkRevert.php index cc22a27..238bb60 100644 --- a/core/modules/node/src/Plugin/views/field/RevisionLinkRevert.php +++ b/core/modules/node/src/Plugin/views/field/RevisionLinkRevert.php @@ -7,7 +7,6 @@ namespace Drupal\node\Plugin\views\field; -use Drupal\Core\Session\AccountInterface; use Drupal\node\Plugin\views\field\RevisionLink; use Drupal\views\ResultRow; @@ -38,6 +37,7 @@ class RevisionLinkRevert extends RevisionLink { protected function renderLink($data, ResultRow $values) { list($node, , $vid) = $this->getRevisionEntity($values, 'update'); + /** @var \Drupal\node\NodeInterface $node */ $type = $node->bundle(); if (!($access = ($this->currentUser->hasPermission("revert $type revisions") || $this->currentUser->hasPermission('revert all revisions') || $this->currentUser->hasPermission('administer nodes')) && $node->access('update'))) { return; diff --git a/core/modules/node/tests/modules/node_test_views/test_views/views.view.test_node_revision_links.yml b/core/modules/node/tests/modules/node_test_views/test_views/views.view.test_node_revision_links.yml index 4f2e457..9da233d 100644 --- a/core/modules/node/tests/modules/node_test_views/test_views/views.view.test_node_revision_links.yml +++ b/core/modules/node/tests/modules/node_test_views/test_views/views.view.test_node_revision_links.yml @@ -1,6 +1,16 @@ +langcode: und +status: true +dependencies: + module: + - node +id: test_node_revision_links +label: test_node_revision_links +module: views +description: '' +tag: '' base_field: vid base_table: node_field_revision -core: 8.x +core: '8' description: '' display: default: @@ -213,9 +223,3 @@ display: position: '1' display_options: path: test-node-revision-links -label: test_node_revision_links -module: views -id: test_node_revision_links -tag: '' -uuid: c89579e2-be88-44e6-81f8-6d5e50b81a05 -langcode: en