Verified Commit 3a9e58f6 authored by Alex Pott's avatar Alex Pott
Browse files

Issue #2926958 by Spokje, andypost, Ratan Priya, MeenakshiG, ravi.shankar,...

Issue #2926958 by Spokje, andypost, Ratan Priya, MeenakshiG, ravi.shankar, Berdir, alexpott, plach, xjm, longwave: Remove revision-related methods from EntityStorageInterface
parent d9059c06
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -122,6 +122,8 @@ public static function createInstance(ContainerInterface $container, EntityTypeI
   * {@inheritdoc}
   */
  public function loadRevision($revision_id) {
    @trigger_error(__METHOD__ . '() is deprecated in drupal:10.1.0 and is removed from drupal:11.0.0. Use \Drupal\Core\Entity\RevisionableStorageInterface::loadRevision instead. See https://www.drupal.org/node/3294237', E_USER_DEPRECATED);

    return NULL;
  }

@@ -129,6 +131,8 @@ public function loadRevision($revision_id) {
   * {@inheritdoc}
   */
  public function deleteRevision($revision_id) {
    @trigger_error(__METHOD__ . '() is deprecated in drupal:10.1.0 and is removed from drupal:11.0.0. Use \Drupal\Core\Entity\RevisionableStorageInterface::deleteRevision instead. See https://www.drupal.org/node/3294237', E_USER_DEPRECATED);

    return NULL;
  }

+6 −4
Original line number Diff line number Diff line
@@ -80,11 +80,12 @@ public function loadUnchanged($id);
   * @return \Drupal\Core\Entity\EntityInterface|null
   *   The specified entity revision or NULL if not found.
   *
   * @todo Deprecated in Drupal 8.5.0 and will be removed before Drupal 9.0.0.
   *   Use \Drupal\Core\Entity\RevisionableStorageInterface instead.
   * @deprecated in drupal:10.1.0 and is removed from drupal:11.0.0. Use
   * \Drupal\Core\Entity\RevisionableStorageInterface::loadRevision instead.
   *
   * @see https://www.drupal.org/node/2926958
   * @see https://www.drupal.org/node/2927226
   * @see https://www.drupal.org/node/3294237
   */
  public function loadRevision($revision_id);

@@ -96,11 +97,12 @@ public function loadRevision($revision_id);
   * @param int $revision_id
   *   The revision id.
   *
   * @todo Deprecated in Drupal 8.5.0 and will be removed before Drupal 9.0.0.
   *   Use \Drupal\Core\Entity\RevisionableStorageInterface instead.
   * @deprecated in drupal:10.1.0 and is removed from drupal:11.0.0. Use
   * \Drupal\Core\Entity\RevisionableStorageInterface::deleteRevision instead.
   *
   * @see https://www.drupal.org/node/2926958
   * @see https://www.drupal.org/node/2927226
   * @see https://www.drupal.org/node/3294237
   */
  public function deleteRevision($revision_id);

+4 −0
Original line number Diff line number Diff line
@@ -132,6 +132,8 @@ public function doLoadMultiple(array $ids = NULL) {
   * {@inheritdoc}
   */
  public function loadRevision($revision_id) {
    @trigger_error(__METHOD__ . '() is deprecated in drupal:10.1.0 and is removed from drupal:11.0.0. Use \Drupal\Core\Entity\RevisionableStorageInterface::loadRevision instead. See https://www.drupal.org/node/3294237', E_USER_DEPRECATED);

    return NULL;
  }

@@ -139,6 +141,8 @@ public function loadRevision($revision_id) {
   * {@inheritdoc}
   */
  public function deleteRevision($revision_id) {
    @trigger_error(__METHOD__ . '() is deprecated in drupal:10.1.0 and is removed from drupal:11.0.0. Use \Drupal\Core\Entity\RevisionableStorageInterface::deleteRevision instead. See https://www.drupal.org/node/3294237', E_USER_DEPRECATED);

    return NULL;
  }

+5 −0
Original line number Diff line number Diff line
@@ -629,15 +629,20 @@ public function testLoadMultipleIds() {

  /**
   * @covers ::loadRevision
   * @group legacy
   */
  public function testLoadRevision() {
    $this->expectDeprecation('Drupal\Core\Config\Entity\ConfigEntityStorage::loadRevision() is deprecated in drupal:10.1.0 and is removed from drupal:11.0.0. Use \Drupal\Core\Entity\RevisionableStorageInterface::loadRevision instead. See https://www.drupal.org/node/3294237');
    $this->assertSame(NULL, $this->entityStorage->loadRevision(1));
  }

  /**
   * @covers ::deleteRevision
   * @group legacy
   */
  public function testDeleteRevision() {
    $this->expectDeprecation('Drupal\Core\Config\Entity\ConfigEntityStorage::deleteRevision() is deprecated in drupal:10.1.0 and is removed from drupal:11.0.0. Use \Drupal\Core\Entity\RevisionableStorageInterface::deleteRevision instead. See https://www.drupal.org/node/3294237');

    $this->cacheTagsInvalidator->invalidateTags(Argument::cetera())
      ->shouldNotBeCalled();

+4 −0
Original line number Diff line number Diff line
@@ -543,8 +543,10 @@ public function testLoadMultipleIds() {

  /**
   * @covers ::loadRevision
   * @group legacy
   */
  public function testLoadRevision() {
    $this->expectDeprecation('Drupal\Core\Entity\KeyValueStore\KeyValueEntityStorage::loadRevision() is deprecated in drupal:10.1.0 and is removed from drupal:11.0.0. Use \Drupal\Core\Entity\RevisionableStorageInterface::loadRevision instead. See https://www.drupal.org/node/3294237');
    $this->setUpKeyValueEntityStorage();

    $this->assertSame(NULL, $this->entityStorage->loadRevision(1));
@@ -552,8 +554,10 @@ public function testLoadRevision() {

  /**
   * @covers ::deleteRevision
   * @group legacy
   */
  public function testDeleteRevision() {
    $this->expectDeprecation('Drupal\Core\Entity\KeyValueStore\KeyValueEntityStorage::deleteRevision() is deprecated in drupal:10.1.0 and is removed from drupal:11.0.0. Use \Drupal\Core\Entity\RevisionableStorageInterface::deleteRevision instead. See https://www.drupal.org/node/3294237');
    $this->setUpKeyValueEntityStorage();

    $this->assertSame(NULL, $this->entityStorage->deleteRevision(1));