diff --git a/core/modules/node/lib/Drupal/node/Tests/Views/RevisionLinkTest.php b/core/modules/node/lib/Drupal/node/Tests/Views/RevisionLinkTest.php index d034b07..177d0bc 100644 --- a/core/modules/node/lib/Drupal/node/Tests/Views/RevisionLinkTest.php +++ b/core/modules/node/lib/Drupal/node/Tests/Views/RevisionLinkTest.php @@ -40,7 +40,7 @@ public static function getInfo() { */ public function testRevisionLinks() { // Create one user which can view/revert and delete and one which can only - // one of them. + // do one of them. $this->drupalCreateContentType(array('name' => 'page', 'type' => 'page')); $account = $this->drupalCreateUser(array('revert all revisions', 'view all revisions', 'delete all revisions', 'edit any page content', 'delete any page content')); $this->drupalLogin($account); @@ -60,7 +60,7 @@ public function testRevisionLinks() { $this->drupalGet('test-node-revision-links'); $this->assertResponse(200, 'Test view can be accessed in the path expected'); - // The first node revision should link to the node directly as you get a + // The first node revision should link to the node directly as you get an // access denied if you link to the revision. $path = $this->nodes[0]->getSystemPath(); $this->assertLinkByHref($path); diff --git a/core/modules/node/src/Plugin/views/field/RevisionLink.php b/core/modules/node/src/Plugin/views/field/RevisionLink.php index 360ae42..48924b2 100644 --- a/core/modules/node/src/Plugin/views/field/RevisionLink.php +++ b/core/modules/node/src/Plugin/views/field/RevisionLink.php @@ -80,7 +80,7 @@ public function __construct(array $configuration, $plugin_id, array $plugin_defi /** * {@inheritdoc} */ - public static function create(ContainerInterface $container, array $configuration, $plugin_id, array $plugin_definition) { + public static function create(ContainerInterface $container, array $configuration, $plugin_id, $plugin_definition) { return new static( $configuration, $plugin_id, @@ -157,7 +157,7 @@ protected function renderLink($data, ResultRow $values) { * Containing current node, node revision object and revision ID. */ public function getRevisionEntity(ResultRow $values, $op) { - $storage_controller = $this->entityManager->getStorageController('node'); + $storage_controller = $this->entityManager->getStorage('node'); $vid = $this->getValue($values, 'vid'); $revision_node = $storage_controller->loadRevision($vid); $node = $storage_controller->load($revision_node->id()); diff --git a/core/modules/node/src/Plugin/views/field/RevisionLinkDelete.php b/core/modules/node/src/Plugin/views/field/RevisionLinkDelete.php index 10c782d..258e715 100644 --- a/core/modules/node/src/Plugin/views/field/RevisionLinkDelete.php +++ b/core/modules/node/src/Plugin/views/field/RevisionLinkDelete.php @@ -39,7 +39,7 @@ protected function renderLink($data, ResultRow $values) { list($node, $revision_node, $vid) = $this->getRevisionEntity($values, 'update'); $type = $node->getType(); - if (!(($this->currentUser->hasPermission("delete $type revisions") || $this->currentUser->hasPermission('delete all revisions') || $this->currentUser->hasPermission('administer nodes')) && node_access('delete', $revision_node))) { + 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 01ec53b..f9d84ea 100644 --- a/core/modules/node/src/Plugin/views/field/RevisionLinkRevert.php +++ b/core/modules/node/src/Plugin/views/field/RevisionLinkRevert.php @@ -39,7 +39,7 @@ protected function renderLink($data, ResultRow $values) { list($node, , $vid) = $this->getRevisionEntity($values, 'update'); $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', $node))) { + 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 d387c3e..4f2e457 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 @@ -42,7 +42,7 @@ display: fields: link_to_revision: id: link_to_revision - table: node_field_revision + table: node_revision field: link_to_revision relationship: none group_type: group @@ -92,7 +92,7 @@ display: plugin_id: node_revision_link delete_revision: id: delete_revision - table: node_field_revision + table: node_revision field: delete_revision relationship: none group_type: group @@ -142,7 +142,7 @@ display: plugin_id: node_revision_link_delete revert_revision: id: revert_revision - table: node_field_revision + table: node_revision field: revert_revision relationship: none group_type: group @@ -193,7 +193,7 @@ display: filters: status: value: '1' - table: node_field_revision + table: node_revision field: status id: status expose: