Support Forum

Advanced Search
Forum Scope


Match



Forum Options



Minimum search word length is 3 characters - maximum search word length is 84 characters
general-topic
Problem adding/deleting cron for sph_subs_digest_cron
Avatar
Natalya Murphy
Member
Free Members
sp_UserOfflineSmall Offline
Dec 1, 2012 - 9:43 am

I wanted to change the run time for the sph_subs_digest_cron.  Since I didn't see an edit option, I figured I would add a cron with the new desired run time and then delete the current cron job.  Unfortunately, I can't see to do either without problems.

First I tried adding the cron using the following field values:

  • Next run timestamp: 1354438860
  • interval: sp_subs_digest_interval
  • hook: sph_subs_digest_cron
  • arguments: (left blank)

The cron shows up in the listing but gives the following message, even though I didn't supply any arguments: "Warning: Invalid argument supplied for foreach() in /problem-with-post-edit-buttonome/chaohome/public_html/test/wp-content/plugins/simple-press/admin/panel-toolbox/forms/spa-toolbox-cron-form.php on line 105"

Then I tried deleting the old cron by putting in the timestamp and hook and leaving the arguments field blank.  SP claims the cron was deleted but it still shows up in the list.

Ultimately, all I want to do is to get the cron to run at a different time.  So I need to either successfully add/delete the job or find a way to change the next-run time for the current cron.

Avatar
Mr Papa
Simi Valley, CA
SP Master
Free Members
sp_UserOfflineSmall Offline
Dec 1, 2012 - 11:48 am

looks like there is a problem with deleting some crons...  we pass an empty string for args if none... it expects an empty array...  and unfortunately, the wp functions for deleting crons dont return success of failure, so we have to assume success...

will get that fixed up in next version...

if you want to make change yourself, its simple change...  in simple-press/admin/panel-toolbox/support/spa-toolbox-support.php, around line 206, change:

    $delArgs = (!empty($_POST['del-args'])) ? sp_esc_str($_POST['del-args']) : '';

to

    $delArgs = (!empty($_POST['del-args'])) ? sp_esc_str($_POST['del-args']) : array();

and you will be able to delete a cron...  as I said, will get it fixed in next version...

probably should make similar change on line 193 for adding crons...

but that said, I cannot duplicate your error with adding... I can add a cron job just fine...  the error indicates issue with args, but as I said cannot duplicate that...  so try the line 193 change and see if that corrects...

 

Forum Timezone: Europe/Stockholm
Most Users Ever Online: 1170
Currently Online:
Guest(s) 1
Currently Browsing this Page:
1 Guest(s)
Top Posters:
Mr Papa: 19448
Ike: 2086
Brandon: 864
kvr28: 804
jim: 650
FidoSysop: 577
Conrad_Farlow: 531
fiddlerman: 358
Stefano Prete: 325
Member Stats:
Guest Posters: 619
Members: 17362
Moderators: 0
Admins: 4
Forum Stats:
Groups: 7
Forums: 17
Topics: 10127
Posts: 79625