1 node.module node_get_node_tempstore($node_tempstore_id)

Get a node from the tempstore.

@since 1.11.0


string $node_tempstore_id: The tempstore ID of the node item to load.

Return value

Node|FALSE: A fully-populated node entity, or FALSE if the node is not found.


core/modules/node/node.module, line 3811
The core module that allows content to be submitted to the site.


function node_get_node_tempstore($node_tempstore_id) {
  $caches = &backdrop_static(__FUNCTION__, array());
  if (!isset($caches[$node_tempstore_id])) {
    // Try loading from tempstore first to get in-progress changes.
    $item = tempstore_get('node_tempstore', $node_tempstore_id);
    $caches[$node_tempstore_id] = $item;

  return $caches[$node_tempstore_id];