Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

EntityStorageInterface::loadRevision is deprecated #4112

Merged
merged 4 commits into from
Feb 13, 2024

Conversation

paul-m
Copy link
Contributor

@paul-m paul-m commented Feb 7, 2024

  1x: The Drupal\Core\Entity\EntityStorageInterface::loadRevision method is deprecated (in drupal:10.1.0 and is removed from drupal:11.0.0. Use \Drupal\Core\Entity\RevisionableStorageInterface::loadRevision instead.).
    1x in ResourcePurgerTest::testRevisionDisappearing from Drupal\Tests\datastore\Unit\Service 

This is used in a number of places within DKAN core.

CRs:

https://www.drupal.org/node/2927226

https://www.drupal.org/node/3294237

Since RevisionableStorageInterface was added in Drupal 8.5.0, we're good on BC.

Analysis:

Since the only place this deprecation is being thrown is Drupal\Tests\datastore\Unit\Service\ResourcePurgerTest, we can deduce that we're good in other places within DKAN.

ResourcePurgerTest uses NodeStorageInterface to mock node storage, which seems reasonable. However, for some reason, even though NodeStorageInterface inherits from RevisionableStorageInterface, we see this deprecation message.

So since ResourcePurgerTest only mocks methods of NodeStorageInterface which are also in RevisionableStorageInterface, we can mock RevisionableStorageInterface instead. We now don't see those deprecation messages.

Testing:

  • Use Drupal 10.1.x in a local environment.
  • Configure PHPUnit to use symfony/phpunit-bridge to report deprecations.
  • Run tests.
  • Verify that no deprecation messages related to EntityStorageInterface arise.

@paul-m paul-m marked this pull request as ready for review February 9, 2024 17:57
@janette janette merged commit 116eee3 into 2.x Feb 13, 2024
12 checks passed
@janette janette deleted the 18617-entitystorageinterface-deprecated branch February 13, 2024 04:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants