Problem/Motivation

Spotted in a test over in #3319582: Fix calls to methods with too many parameters passed in, we deprecated and removed node_load() a long time ago but the following functions still exist in node.module:

function node_revision_load($vid = NULL) {
  return \Drupal::entityTypeManager()->getStorage('node')->loadRevision($vid);
}

function node_revision_delete($revision_id) {
  \Drupal::entityTypeManager()->getStorage('node')->deleteRevision($revision_id);
}

function node_type_update_nodes($old_id, $new_id) {
  return \Drupal::entityTypeManager()->getStorage('node')->updateType($old_id, $new_id);
}

Steps to reproduce

Proposed resolution

Deprecate these functions and use the entity storage methods in preference.

Remaining tasks

User interface changes

API changes

Data model changes

Release notes snippet

Issue fork drupal-3323260

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

longwave created an issue. See original summary.

longwave’s picture

Issue summary: View changes
Spokje’s picture

Assigned: Unassigned » Spokje

Spokje’s picture

Assigned: Spokje » Unassigned
Status: Active » Needs review
longwave’s picture

Status: Needs review » Needs work

Thanks, added some feedback - in a number of cases the entity storage object is already available.

Spokje’s picture

Status: Needs work » Needs review

Thanks @longwave for correcting my sloppiness there. :)

mondrake’s picture

Status: Needs review » Reviewed & tested by the community

It looks all correct to me.

alexpott’s picture

Version: 10.1.x-dev » 10.0.x-dev
Status: Reviewed & tested by the community » Fixed

Committed d9059c0 and pushed to 10.1.x. Thanks!

I backported all the non deprecation changes to 10.0.x to keeps tests and phpstan aligned.

Committed ef4dc87 and pushed to 10.0.x. Thanks!

  • alexpott committed d9059c0 on 10.1.x
    Issue #3323260 by Spokje, longwave: Deprecate node_revision_load() and...

  • alexpott committed ef4dc87 on 10.0.x
    Issue #3323260 by Spokje, longwave: Remove usage of node_revision_load...

Spokje’s picture

Published CR.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.