You are here

function workbench_moderation_node_current_load in Workbench Moderation 7.3

Same name and namespace in other branches
  1. 7 workbench_moderation.module \workbench_moderation_node_current_load()

Utility function to load the current revision of a node.

Parameters

$node: The node being acted upon.

Return value

The current node according to moderation.

11 calls to workbench_moderation_node_current_load()
WorkbenchModerationFilesTestCase::testModeratedFileField in tests/workbench_moderation.files.test
WorkbenchModerationModerateTabTestCase::testModerateTab in tests/workbench_moderation.test
WorkbenchModerationNodeAccessTestCase::testNodeAccessRecords in tests/workbench_moderation.node_access.test
Creates a node and tests the creation of node access rules.
workbench_moderation_load_current_revision_rules_action in ./workbench_moderation.rules.inc
Action: Loads the current node revision.
workbench_moderation_moderate_form_validate in ./workbench_moderation.module

... See full list

File

./workbench_moderation.module, line 1329
Content moderation for Workbench.

Code

function workbench_moderation_node_current_load($node) {

  // Is there a current revision?
  if (isset($node->workbench_moderation['current']->vid)) {

    // Ensure that we will return the current revision
    if ($node->vid != $node->workbench_moderation['current']->vid) {
      $node = node_load($node->nid, $node->workbench_moderation['current']->vid);
    }
  }
  return $node;
}