Scheduler module: rewritten

On the long plane ride home from London today (I was out there building the new MTV.co.uk site that is going live early August 2006, see some pictures), I decided to completely rewrite the scheduler module. I based the rewrite upon an earlier article I wrote about the TWiT.tv site where I was using a simple publishing nodes technique.

I talked with Gerhard Killesreiter who maintains the Drupal CVS repository and he said the scheduler module was mostly abandoned and needed some love. So I stepped up to the plate, took a big swing, and got the module back in working shape. Not only that, but I cleaned up the issue queue too. Not too shabby for 2 hours of sleep and switching back 5 hours from one timezone to another in the same day :-)

Hi Ted, great work, thanks

Hi Ted,

great work, thanks for your effort!

Bye, Gerald

This is great news and one

This is great news and one of the modules that needed a lot of love and a maintainer as well.

So thank you!

Thanks a lot! We use this

Thanks a lot! We use this heavily on Weblabor.hu (Drupal 4.6), and we intend to upgrade, so an upgraded scheduler is very good news for us.

Hi Ted!! Your great work and

Hi Ted!!

Your great work and effort kicks major ass!!! Bookmarked!!!

Thanx for it!! Ben

I got scheduler from the

I got scheduler from the main drupal site (http://ftp.osuosl.org/pub/drupal/files/projects/scheduler-4.7.0 — I’m assuming this is your version?) and had some problems with nodes not publishing/unpublishing at the right times. (For instance, a node scheduled to publish in ten minutes would be published as soon as cron ran.) Here’s what I had to do to scheduler_cron to get it to behave

(a) I added the timezone of the scheduled event into the queries looking for nodes that are ready to be published/unpublished (lines 168 and 190):

  1.   $nodes = db_query('SELECT * FROM {scheduler} s LEFT JOIN {node} n ON s.nid = n.nid WHERE n.status = 0 AND s.publish_on > 0 AND s.publish_on < %d + s.timezone', time());

(b) line 174 has a typo: it should read:

  1.     if ($node->unpublish_on == 0) {

Does this make sense? It seems to be behaving properly on my installation with these changes.

Just checking / hoping to help, Jim

Thanks Jim! I've actually

Thanks Jim! I’ve actually just committed both of this fixes, should be good now I hope. I’ve learned that dealing with timezones can really make your headspin, eek!

Post new comment

The content of this field is kept private and will not be shown publicly.
  • You can use Textile markup to format text.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd> <p> <img> <pre>
  • You can enable syntax highlighting of source code with the following tags: <code>, <blockcode>. Beside the tag style "<foo>" it is also possible to use "[foo]". PHP source code can also be enclosed in <?php ... ?> or <% ... %>.

More information about formatting options