function lingotek_node_load_default in Lingotek Translation 7.5
Same name and namespace in other branches
- 7.7 lingotek.module \lingotek_node_load_default()
- 7.3 lingotek.util.inc \lingotek_node_load_default()
- 7.4 lingotek.module \lingotek_node_load_default()
- 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
Parameters
$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 ./
lingotek.page.inc - Submit handler for the lingotek_advanced_parsing_upgrade_form form.
- lingotek_entity_changed in ./
lingotek.util.inc - lingotek_entity_load_single in ./
lingotek.module - lingotek_form_node_form_alter in ./
lingotek.module - Implements hook_form_BASE_FORM_ID_alter().
File
- ./
lingotek.module, line 1269
Code
function lingotek_node_load_default($nid, $vid = NULL, $reset = FALSE) {
if ($vid == NULL) {
$query = db_select('{node_revision}', 'nr')
->condition('nid', $nid, '=');
$query
->addExpression('MAX(vid)', 'max_vid');
$vid = $query
->execute()
->fetchField();
}
$node = node_load($nid, $vid, $reset);
return $node;
}