Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
By Spokje on
Change record status:
Published (View all published change records)
Project:
Introduced in branch:
10.1.x
Introduced in version:
10.1.0
Issue links:
Description:
node_revision_load
, node_revision_delete
and node_type_update_nodes
are deprecated in Drupal 10.1.0 and are removed before Drupal 11.0.0.
Use the entity storage methods:
For node_revision_load
use \Drupal\Core\Entity\EntityStorageInterface::loadRevision
For node_revision_delete
use \Drupal\Core\Entity\EntityStorageInterface::deleteRevision
For node_type_update_nodes
use \Drupal\Core\Entity\EntityStorageInterface::updateType
Impacts:
Module developers
Comments
Actually use RevisionableStorageInterface
Note the actual class you'd be using in your code is:
\Drupal\Core\Entity\RevisionableStorageInterface
The relevant methods in that class are the same those listed above.
See https://api.drupal.org/api/drupal/core%21modules%21node%21node.module/fu...
and see the class definition here:
https://api.drupal.org/api/drupal/core%21lib%21Drupal%21Core%21Entity%21...
This can be accessed via
\Drupal::entityTypeManager()->getStorage($entity_type);
For example:
Also:
Also:
For
node_type_update_nodes
use \Drupal\Core\Entity\EntityStorageInterface::updateType
should be onNodeStorageInterface
.