Simpleads being reactivated incorrectly

Created on 13 March 2015, over 9 years ago
Updated 9 June 2023, about 1 year ago

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) {

πŸ› Bug report
Status

Closed: won't fix

Version

1.9

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States JordanMagnuson

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.69.0 2024