Hi,

I use node_load/node_save a lot for programmatic node creation/update.

Currently, scheduler does not have the 'load' action hook for nodeapi. This causes problems for the usual node_load/node_save scripts that I use. I could make direct calls to the scheduler database table, but then 'update' and 'insert' actions are already there and invoked by node_save.

So I've added some code to hook on to the 'load' action as well.

I hope this helps someone else, and kindly review this for inclusion.

Patch attached.

CommentFileSizeAuthor
scheduler_nodeapi-load_patch.txt1.05 KBfreeman-1

Comments

AjK’s picture

Status: Needs review » Fixed

Committed, thanks!

Some points as I didn't apply the patch you supplied but tweaked it.

  1. You had tabs instead of the Drupal standard "2 spaces" for indentation.
  2. You added the data as formatted by date and your formatting was fixed. I used Drupals standard "long date" variable instead.
  3. I added it as a "raw" data and formatted data array to ->scheduler so the raw row data and your date formatted data is available. See code http://drupal.org/cvs?commit=66257 for details.
  4. .

freeman-1’s picture

Thanks for the quick review, changes and inclusion. I'm still a little rough around the edges on Drupal conventions/best-practices :-)

I guess putting the settings/fields under the ->scheduler array is a cleaner approach (like taxonomy) although there'd need to be some code to assign them to ->(un)publish_on if i run loops using the current module and node_save.

I suppose a future ToDo would include getting the other actions to handle ->scheduler as an array/object (and not need the code mentioned above) ?
If so, I'd be glad to chip in later on.

AjK’s picture

If so, I'd be glad to chip in later on.

All patches welcome! :)

Anonymous’s picture

Status: Fixed » Closed (fixed)