You are here

function lingotek_node_load_default in Lingotek Translation 7.5

Same name and namespace in other branches
  1. 7.7 lingotek.module \lingotek_node_load_default()
  2. 7.3 \lingotek_node_load_default()
  3. 7.4 lingotek.module \lingotek_node_load_default()
  4. 7.6 lingotek.module \lingotek_node_load_default()

Lingotek custom wrapper function for node_load

This is needed because the Lingotek module should translate only the most current revision of any node


$nid entity_id of node to load:

Return value

$node most current revision of the node at $nid

12 calls to lingotek_node_load_default()
lingotek_advanced_parsing_update_node in ./lingotek.module
Processing callback for the advanced parsing update batch operation.
lingotek_advanced_parsing_upgrade_form_submit in ./
Submit handler for the lingotek_advanced_parsing_upgrade_form form.
lingotek_entity_changed in ./
lingotek_entity_load_single in ./lingotek.module
lingotek_form_node_form_alter in ./lingotek.module
Implements hook_form_BASE_FORM_ID_alter().

... See full list


./lingotek.module, line 1269


function lingotek_node_load_default($nid, $vid = NULL, $reset = FALSE) {
  if ($vid == NULL) {
    $query = db_select('{node_revision}', 'nr')
      ->condition('nid', $nid, '=');
      ->addExpression('MAX(vid)', 'max_vid');
    $vid = $query
  $node = node_load($nid, $vid, $reset);
  return $node;