Commit 724a75e2 authored by Gábor Hojtsy's avatar Gábor Hojtsy

bugfix: really remove schedule times, if the admin asked for it

parent ac8e687a
......@@ -31,8 +31,9 @@ function scheduler_settings() {
}
function scheduler_write($node, $op, $arg) {
if (user_access('schedule nodes') && ($node->scheduler_post || $node->scheduler_hide)) {
if (user_access('schedule nodes')) {
$conds = array();
if ($node->scheduler_post) {
$conds['timestamp_posted'] = scheduler_nodetime($node, 'post');
}
......@@ -45,6 +46,12 @@ function scheduler_write($node, $op, $arg) {
else {
$conds['timestamp_hidden'] = 0;
}
// No schedule needs to take place (works for update and insert too)
if (array_sum($conds) == 0) {
$result = db_query('DELETE FROM {scheduler} WHERE nid = %d', $node->nid);
return;
}
if ($op !== 'insert') {
// Determine whether we must UPDATE or INSERT, then do it
......
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