This patch runs the node update trough the proper Drupal channels, by calling node_save when (un)publishing. This is a lot better then poking in the database for three reasons:
* It allows other modules (such as workflow) to hook into the event of updating. This is crucial.
* It is the right way to do it: node_save is there for exactly such events.
* It is future proof: we don't need to maintain database schemes.

One downside is that for larger amounts of nodes/events, this performs rather bad.

CommentFileSizeAuthor
#1 scheduler_node_save.patch6.94 KBBèr Kessels

Comments

Bèr Kessels’s picture

Status: Active » Needs review
StatusFileSize
new6.94 KB

And here is a patch.

Bèr Kessels’s picture

Title: use node_safe instead of poking around in the database » use node_save instead of poking around in the database

typo in the title of this issue.

AjK’s picture

Category: task » bug
Status: Needs review » Fixed

The patch contained the node_save() code and also the "split out" of http://drupal.org/node/137802.

The node_save() (as per this issue) was committed:
http://drupal.org/cvs?commit=66249
http://drupal.org/cvs?commit=66250

Also, imho not using the API to do that was really a bug and not a task, marked issue as such.

Anonymous’s picture

Status: Fixed » Closed (fixed)