Commit b1c61c05 authored by Paulo Henrique Cota Starling's avatar Paulo Henrique Cota Starling Committed by Jacob Rockowitz
Browse files

Issue #3251295 by paulocs, jrockowitz: [Drupal 9.x] Remove Webform::url,...

Issue #3251295 by paulocs, jrockowitz: [Drupal 9.x] Remove Webform::url, Webform::urlInfo() and Webform::link() methods
parent 5d377ae2
Loading
Loading
Loading
Loading
+0 −40
Original line number Diff line number Diff line
@@ -3026,24 +3026,6 @@ class Webform extends ConfigEntityBundleBase implements WebformInterface {
  // URL.
  /* ************************************************************************ */

  /**
   * {@inheritdoc}
   *
   * Overriding so that URLs pointing to webform default to 'canonical'
   * submission webform and not the back-end 'edit-form'.
   */
  public function url($rel = 'canonical', $options = []) {
    @trigger_error('Webform::url() function is deprecated in drupal:8.0.0 and is removed from drupal:9.0.0. Use \Drupal\webform\Entity\Webform::toUrl() instead. See https://www.drupal.org/project/webform/issues/3251189', E_USER_DEPRECATED);
    // Do not remove this override: the default value of $rel is different.
    if ($this->id() === NULL || !$this->hasLinkTemplate($rel)) {
      return '';
    }
    $uri = $this->toUrl($rel);
    $options += $uri->getOptions();
    $uri->setOptions($options);
    return $uri->toString();
  }

  /**
   * {@inheritdoc}
   *
@@ -3054,17 +3036,6 @@ class Webform extends ConfigEntityBundleBase implements WebformInterface {
    return parent::toUrl($rel, $options);
  }

  /**
   * {@inheritdoc}
   *
   * Overriding so that URLs pointing to webform default to 'canonical'
   * submission webform and not the back-end 'edit-form'.
   */
  public function urlInfo($rel = 'canonical', array $options = []) {
    @trigger_error('Webform::urlInfo() function is deprecated in drupal:8.0.0 and is removed from drupal:9.0.0. Use \Drupal\webform\Entity\Webform::toUrl() instead. See https://www.drupal.org/project/webform/issues/3251189', E_USER_DEPRECATED);
    return parent::toUrl($rel, $options);
  }

  /**
   * {@inheritdoc}
   *
@@ -3075,17 +3046,6 @@ class Webform extends ConfigEntityBundleBase implements WebformInterface {
    return parent::toLink($text, $rel, $options);
  }

  /**
   * {@inheritdoc}
   *
   * Overriding so that links to webform default to 'canonical' submission
   * webform and not the back-end 'edit-form'.
   */
  public function link($text = NULL, $rel = 'canonical', array $options = []) {
    @trigger_error('Webform::link() function is deprecated in drupal:8.0.0 and is removed from drupal:9.0.0. Use \Drupal\webform\Entity\Webform::toLink() instead. See https://www.drupal.org/project/webform/issues/3251189', E_USER_DEPRECATED);
    return parent::toLink($text, $rel, $options)->toString();
  }

  /* ************************************************************************ */
  // Revisions.
  /* ************************************************************************ */