Commit 176f7ea5 authored by raystuart's avatar raystuart Committed by fmitchell

Issue #2210623 by raystuart | fmitchell: Scheduling a poorly formed node or vid can break cron.

parent ff32fc1f
7.x-2.4
--------------
#2210623 by raystuart | fmitchell: Scheduling a poorly formed node or vid can break cron.
7.x-2.3
--------------
#2159449 by kchh90: State flow state filter handler uses machine name instead of labels for the options.
......
......@@ -185,10 +185,11 @@ function state_flow_schedule_process_item($data) {
$nid = (isset($data->nid)) ? $data->nid : 0;
$vid = (isset($data->vid)) ? $data->vid : 0;
if ($nid && $vid) {
$node = node_load($nid, $vid);
drupal_set_message('Attempting to publish nid:' . $node->nid . ', vid:' . $node->vid);
$state_flow = state_flow_load_state_machine($node, TRUE);
$state_flow->fire_event('publish', $user->uid, 'Published on cron.');
if ($node = node_load($nid, $vid)) {
drupal_set_message('Attempting to publish nid:' . $node->nid . ', vid:' . $node->vid);
$state_flow = state_flow_load_state_machine($node, TRUE);
$state_flow->fire_event('publish', $user->uid, 'Published on cron.');
}
}
}
......@@ -250,4 +251,4 @@ function state_flow_schedule_node_revision_delete($node) {
->condition('nid', $node->nid)
->condition('vid', $node->vid)
->execute();
}
\ No newline at end of file
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment