From 0dbceaa4ebd15cadffe7a1c917e202caebe37a08 Mon Sep 17 00:00:00 2001
From: Alex Pott <alex.a.pott@googlemail.com>
Date: Sun, 9 Jun 2019 01:10:35 +0100
Subject: [PATCH] Issue #3059564 by yogeshmpawar, fredysan, init90, joachim,
 alexpott: error in deprecation note on EntityInterface::link()

(cherry picked from commit 1546b4b85a1c3238cb56616f223b1ad8fbcb4288)
---
 core/lib/Drupal/Core/Entity/EntityBase.php            | 2 +-
 core/lib/Drupal/Core/Entity/EntityInterface.php       | 4 ++--
 core/tests/Drupal/Tests/Core/Entity/EntityUrlTest.php | 2 +-
 3 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/core/lib/Drupal/Core/Entity/EntityBase.php b/core/lib/Drupal/Core/Entity/EntityBase.php
index ee6d84650c6c..f6d0b358d889 100644
--- a/core/lib/Drupal/Core/Entity/EntityBase.php
+++ b/core/lib/Drupal/Core/Entity/EntityBase.php
@@ -268,7 +268,7 @@ protected function linkTemplates() {
    * {@inheritdoc}
    */
   public function link($text = NULL, $rel = 'canonical', array $options = []) {
-    @trigger_error("EntityInterface::link() is deprecated in Drupal 8.0.0 and will be removed in Drupal 9.0.0. EntityInterface::toLink() instead. Note, the default relationship for configuration entities changes from 'edit-form' to 'canonical'. See https://www.drupal.org/node/2614344", E_USER_DEPRECATED);
+    @trigger_error("EntityInterface::link() is deprecated in Drupal 8.0.0 and will be removed in Drupal 9.0.0. Use EntityInterface::toLink()->toString() instead. Note, the default relationship for configuration entities changes from 'edit-form' to 'canonical'. See https://www.drupal.org/node/2614344", E_USER_DEPRECATED);
     return $this->toLink($text, $rel, $options)->toString();
   }
 
diff --git a/core/lib/Drupal/Core/Entity/EntityInterface.php b/core/lib/Drupal/Core/Entity/EntityInterface.php
index 9cdb435f29b7..e2b5b8ef9bb2 100644
--- a/core/lib/Drupal/Core/Entity/EntityInterface.php
+++ b/core/lib/Drupal/Core/Entity/EntityInterface.php
@@ -189,10 +189,10 @@ public function url($rel = 'canonical', $options = []);
    *   An HTML string containing a link to the entity.
    *
    * @deprecated in Drupal 8.0.0, intended to be removed in Drupal 9.0.0
-   *   Please use toLink() instead.
+   *   Use \Drupal\Core\EntityInterface::toLink()->toString() instead.
    *
    * @see https://www.drupal.org/node/2614344
-   * @see \Drupal\Core\Entity\EntityInterface::toLink
+   * @see \Drupal\Core\Entity\EntityInterface::toLink()
    */
   public function link($text = NULL, $rel = 'canonical', array $options = []);
 
diff --git a/core/tests/Drupal/Tests/Core/Entity/EntityUrlTest.php b/core/tests/Drupal/Tests/Core/Entity/EntityUrlTest.php
index 7027d7f707c2..225da396fa1d 100644
--- a/core/tests/Drupal/Tests/Core/Entity/EntityUrlTest.php
+++ b/core/tests/Drupal/Tests/Core/Entity/EntityUrlTest.php
@@ -406,7 +406,7 @@ public function testUrlInfo($rel, $options) {
    * @covers ::urlInfo
    *
    * @group legacy
-   * @expectedDeprecation EntityInterface::link() is deprecated in Drupal 8.0.0 and will be removed in Drupal 9.0.0. EntityInterface::toLink() instead. Note, the default relationship for configuration entities changes from 'edit-form' to 'canonical'. See https://www.drupal.org/node/2614344
+   * @expectedDeprecation EntityInterface::link() is deprecated in Drupal 8.0.0 and will be removed in Drupal 9.0.0. Use EntityInterface::toLink()->toString() instead. Note, the default relationship for configuration entities changes from 'edit-form' to 'canonical'. See https://www.drupal.org/node/2614344
    */
   public function testLink() {
 
-- 
GitLab