Issue #3059564 by yogeshmpawar, fredysan, init90, joachim, alexpott: error in deprecation note on EntityInterface::link()

merge-requests/1119/head
Alex Pott 2019-06-09 01:10:35 +01:00
parent 8ca1b5a7c5
commit 1546b4b85a
No known key found for this signature in database
GPG Key ID: 31905460D4A69276
3 changed files with 4 additions and 4 deletions

View File

@ -268,7 +268,7 @@ abstract class EntityBase implements EntityInterface {
* {@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();
}

View File

@ -189,10 +189,10 @@ interface EntityInterface extends AccessibleInterface, CacheableDependencyInterf
* 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 = []);

View File

@ -406,7 +406,7 @@ class EntityUrlTest extends UnitTestCase {
* @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() {