diff --git a/core/lib/Drupal/Core/Config/Entity/ConfigEntityStorage.php b/core/lib/Drupal/Core/Config/Entity/ConfigEntityStorage.php index d631a66f97ddc98df4785a413f0554f334f64bbf..3a0bed4ef403c45993b8ec20bc2ba35bd17fe6ed 100644 --- a/core/lib/Drupal/Core/Config/Entity/ConfigEntityStorage.php +++ b/core/lib/Drupal/Core/Config/Entity/ConfigEntityStorage.php @@ -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; } diff --git a/core/lib/Drupal/Core/Entity/EntityStorageInterface.php b/core/lib/Drupal/Core/Entity/EntityStorageInterface.php index 99e6bbf7cb2bf1a2572d0cd9844280d1b37b2d4e..f4c1e8b2f3417a77a9bb35f1ccd98ea6091e16b5 100644 --- a/core/lib/Drupal/Core/Entity/EntityStorageInterface.php +++ b/core/lib/Drupal/Core/Entity/EntityStorageInterface.php @@ -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); diff --git a/core/lib/Drupal/Core/Entity/KeyValueStore/KeyValueEntityStorage.php b/core/lib/Drupal/Core/Entity/KeyValueStore/KeyValueEntityStorage.php index 4fe53ca1b64af5d5f7410399035611c37a08ef52..38516c32a8cc13c2be23a062bc3afa7cb1d2dcb8 100644 --- a/core/lib/Drupal/Core/Entity/KeyValueStore/KeyValueEntityStorage.php +++ b/core/lib/Drupal/Core/Entity/KeyValueStore/KeyValueEntityStorage.php @@ -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; } diff --git a/core/tests/Drupal/Tests/Core/Config/Entity/ConfigEntityStorageTest.php b/core/tests/Drupal/Tests/Core/Config/Entity/ConfigEntityStorageTest.php index edf45b37dc9c0dc9d4c8ec4bbd76a45a80e787a5..772b4942b77e0534e35952d59d6d5d53d2bf522b 100644 --- a/core/tests/Drupal/Tests/Core/Config/Entity/ConfigEntityStorageTest.php +++ b/core/tests/Drupal/Tests/Core/Config/Entity/ConfigEntityStorageTest.php @@ -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(); diff --git a/core/tests/Drupal/Tests/Core/Entity/KeyValueStore/KeyValueEntityStorageTest.php b/core/tests/Drupal/Tests/Core/Entity/KeyValueStore/KeyValueEntityStorageTest.php index 4fd49f09cbe9a1ff3ad70e4f6e3f205c80e5414f..c01eca52ec2ac8ebcb63cd928e2f1016cd1c15bd 100644 --- a/core/tests/Drupal/Tests/Core/Entity/KeyValueStore/KeyValueEntityStorageTest.php +++ b/core/tests/Drupal/Tests/Core/Entity/KeyValueStore/KeyValueEntityStorageTest.php @@ -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));