diff --git a/core/modules/node/lib/Drupal/node/Plugin/views/field/Link.php b/core/modules/node/lib/Drupal/node/Plugin/views/field/Link.php index 15eb8fd..78b152f 100644 --- a/core/modules/node/lib/Drupal/node/Plugin/views/field/Link.php +++ b/core/modules/node/lib/Drupal/node/Plugin/views/field/Link.php @@ -7,8 +7,9 @@ namespace Drupal\node\Plugin\views\field; -use Drupal\views\Plugin\views\field\FieldPluginBase; use Drupal\Component\Annotation\PluginID; +use Drupal\node\NodeInterface; +use Drupal\views\Plugin\views\field\FieldPluginBase; use Drupal\views\ResultRow; /** @@ -66,7 +67,7 @@ public function render(ResultRow $values) { * @return string * The link text. */ - protected function renderLink($node, ResultRow $values) { + protected function renderLink(NodeInterface $node, ResultRow $values) { if (node_access('view', $node)) { $this->options['alter']['make_link'] = TRUE; $this->options['alter']['path'] = 'node/' . $node->id(); 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 821251f..1615a46 100644 --- a/core/modules/node/lib/Drupal/node/Tests/Views/RevisionLinkTest.php +++ b/core/modules/node/lib/Drupal/node/Tests/Views/RevisionLinkTest.php @@ -64,20 +64,20 @@ public function testRevisionLinks() { // access denied if you link to the revision. $uri = $this->nodes[0]->uri(); $this->assertLinkByHref($uri['path']); - $this->assertNoLinkByHref($uri['path'] . '/revisions/' . $this->revisions[0]->vid->value . '/delete'); - $this->assertNoLinkByHref($uri['path'] . '/revision/' . $this->revisions[0]->vid->value . '/revert'); + $this->assertNoLinkByHref($uri['path'] . '/revisions/' . $this->revisions[0]->getRevisionId() . '/delete'); + $this->assertNoLinkByHref($uri['path'] . '/revision/' . $this->revisions[0]->getRevisionId() . '/revert'); // For the second node the current revision got set to the last revision, so // the first one should also link to the node page itself. $uri = $this->revisions[1]->uri(); - $this->assertLinkByHref($uri['path'] . '/revisions/' . $this->revisions[1]->vid->value . '/view'); - $this->assertLinkByHref($uri['path'] . '/revisions/' . $this->revisions[1]->vid->value . '/delete'); - $this->assertLinkByHref($uri['path'] . '/revisions/' . $this->revisions[1]->vid->value . '/revert'); + $this->assertLinkByHref($uri['path'] . '/revisions/' . $this->revisions[1]->getRevisionId() . '/view'); + $this->assertLinkByHref($uri['path'] . '/revisions/' . $this->revisions[1]->getRevisionId() . '/delete'); + $this->assertLinkByHref($uri['path'] . '/revisions/' . $this->revisions[1]->getRevisionId() . '/revert'); $uri = $this->revisions[2]->uri(); $this->assertLinkByHref($uri['path']); - $this->assertNoLinkByHref($uri['path'] . '/revisions/' . $this->revisions[2]->vid->value . '/delete'); - $this->assertNoLinkByHref($uri['path'] . '/revisions/' . $this->revisions[2]->vid->value . '/revert'); + $this->assertNoLinkByHref($uri['path'] . '/revisions/' . $this->revisions[2]->getRevisionId() . '/delete'); + $this->assertNoLinkByHref($uri['path'] . '/revisions/' . $this->revisions[2]->getRevisionId() . '/revert'); $accounts = array(); $accounts['view'] = $this->drupalCreateUser(array('view all revisions')); @@ -95,10 +95,10 @@ public function testRevisionLinks() { // Check expected links. foreach ($operations as $operation) { if ($operation == $op) { - $this->assertLinkByHref($uri['path'] . '/revisions/' . $this->revisions[1]->vid->value . '/' . $operation); + $this->assertLinkByHref($uri['path'] . '/revisions/' . $this->revisions[1]->getRevisionId() . '/' . $operation); } else { - $this->assertNoLinkByHref($uri['path'] . '/revisions/' . $this->revisions[1]->vid->value . '/' . $operation); + $this->assertNoLinkByHref($uri['path'] . '/revisions/' . $this->revisions[1]->getRevisionId() . '/' . $operation); } } }