diff --git a/CHANGELOG b/CHANGELOG index 74a446fe8420fcfa604156fcc3aa08e42d213d9f..8bcf8c1ab33a90b87804776312239113a543df9c 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,3 +1,7 @@ +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. diff --git a/modules/state_flow_schedule/state_flow_schedule.module b/modules/state_flow_schedule/state_flow_schedule.module index 83bb298b6a54da927e34b90d884abe2cf836dc79..98c14bc67b95f00a76058d7a3aa138b46016cc7d 100644 --- a/modules/state_flow_schedule/state_flow_schedule.module +++ b/modules/state_flow_schedule/state_flow_schedule.module @@ -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 +}