Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
There is a bug in _simpleads_activate_deactive_ad() that results in Simpleads being reactivated (re-published) incorrectly at every-other cron run if start date is not set, and end date is in the past.
This block:
elseif ($start_time == '' && $end_time != '') {
if ($end_time <= $now && $current_status == 1) {
$node->status = 0;
if ($who == 'cron') {
node_save($node);
}
}
else {
$node->status = 1;
if ($who == 'cron') {
node_save($node);
}
}
}
Should be changed to:
elseif ($start_time == '' && $end_time != '') {
if ($end_time <= $now && $current_status == 1) {
$node->status = 0;
if ($who == 'cron') {
node_save($node);
}
}
elseif ($endtime > $now && $current_status == 0) {
$node->status = 1;
if ($who == 'cron') {
node_save($node);
}
}
}
else {
is changed to elseif ($endtime > $now && $current_status == 0) {
Comments
Comment #1
minnur CreditAttribution: minnur as a volunteer commented