Call to deprecated method loadRevision() of class Drupal\Core\Entity\ContentEntityStorageBase

Created on 18 April 2024, 7 months ago

Problem/Motivation

Error logged by phpstan

Call to deprecated method loadRevision() of class                                     
 Drupal\Core\Entity\ContentEntityStorageBase:                                          
in drupal:10.1.0 and is removed from drupal:11.0.0. Use                               
\Drupal\Core\Entity\RevisionableStorageInterface::loadRevision                        
instead. 

Steps to reproduce

My unit test code:

   $node = TestHelpers::saveEntity(Node::class, [
      'type' => 'some_type',
      'title' => 'Title',
    ]);
    $node->save();
    $revisonId1 = $node->getRevisionId();
    $node->setNewRevision();
    $node->title = 'New Title',
    $node->save();
    $revisonId2 = $node->getRevisionId();

    $nodeStorage = \Drupal::service('entity_type.manager')->getStorage('node');
    $nodeRevision1 = $nodeStorage->loadRevision($revisonId1);
    $nodeRevision2 = $nodeStorage->loadRevision($revisonId2);

Install PHPStan
Run cmd vendor/bin/phpstan --memory-limit=-1 --no-progress

๐Ÿ› Bug report
Status

Closed: works as designed

Version

1.4

Component

Code

Created by

๐Ÿ‡ฎ๐Ÿ‡ณIndia gaurav_manerkar Vasco Da Gama, Goa

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024