I want to load the node details for a specific revision. I tried using the following code.

use Drupal\node\Entity\Node;
$nid = 1171;
$vid = 9423;
$rev_node = Node::load($nid, $vid, TRUE);

I also tried the following code.

$rev_node = node_load($nid, $vid);

It always loads the latest version, irrespective of the revision ID passed to the method/function call.

Is there a way to load the data for a specific revision?


3 Answers 3


Try with this code:

  • but there is no $node_id specified in this right ??
    – KTM
    May 5, 2017 at 13:30
  • Not working actually
    – KTM
    May 5, 2017 at 13:49
  • 2
    There are no need of node ID because revision id is a unique id and will associate with only one node only. May 6, 2017 at 4:59

You can use

$node = node_load($node_id);

to get the revision IDs for a node.

You can then load a specific revision of a node with $rev = node_revision_load($rev_id);

  • It actually prints out large array unlike a node_load
    – KTM
    May 5, 2017 at 14:55

Actually, entityManager() is deprecated in Drupal 8: https://api.drupal.org/api/drupal/core%21lib%21Drupal.php/function/Drupal%3A%3AentityManager/8.5.x, so, instead, you could use entityTypeManager():


Not the answer you're looking for? Browse other questions tagged or ask your own question.