diff --git a/core/lib/Drupal/Core/Entity/EntityBase.php b/core/lib/Drupal/Core/Entity/EntityBase.php index ee6d84650c6cdacef5c03908fae977b54652af75..f6d0b358d88915c8ae7826b023e9928ca54bd5e1 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 9cdb435f29b7ae4e8b0a1fac4cfab17f5b666959..e2b5b8ef9bb22810fe63c5fd78a2f1328d58b832 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 7027d7f707c2f7563b6b271dfc6bbfa9a055aeb0..225da396fa1d19f329b3c9607716a16ecc58fa7a 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() {