As described here, I understand what presave is doing, but as a shop that has to support numerous clients and has multiple developers/support staff, we frown (for support/upgrade reasons, especially) on ANY hacking of core, so we won't allow installing core patches like the patch that actions 2.x requires making to D5 core in order to add this functionality of presave actions.

Hacking Core Kills Kittens - so sayth Dries and Rasmus Lerdorf and in this case, ebeyrent who runs our shop, CommonPlaces e-Solutions, LLC.

As an alternative for cases when Drupal 5 core is not allowed to be touched, how about the following?

A custom contrib module, that is weighted higher than any other module install (so it always runs last in the invoke chain), with a hook_node_api that does this:

case submit:
node_invoke ($node, 'presave');
node_invoke_nodeapi($node, 'presave');

In other words, chaining it onto the very end of the submit hook (instead of hacking core to add the new hook presave call to node_save)?

The node is not yet saved (so it's functionally still a presave), and submit is _always_ followed by either insert or update (as needed), but submit isn't called if validate has failed (see http://drupal.org/node/356587 for the order of what is called and when)... If we're the very last in the submit hook line, we know the very next step is the save itself.

If you think this will work as an alternative, will you take a patch that adds this as a contrib module (ie patch OR run the contrib module)? If you think it won't work, what's the problem with it?

Comments

Pomliane’s picture

Status: Active » Closed (won't fix)

This version of Actions is not supported anymore. The issue is closed for this reason.
Please upgrade to a supported version and feel free to reopen the issue on the new version if applicable.

This issue has been automagically closed by a script.