Minor request for D7.
Nodes and their revisions are removed from the database before hook_nodeapi is called. This makes doing something with the data in the nodes revisions (before they are removed) impossible. And although the $node object contains a lot of valuable information, some developers may want more. For example, modules that wish to archive or back up purged nodes cannot save the to-be-deleted node as it stands now. There are two possible solutions for this:
1. Pass all the node revisions (as, say, an array) for the node to be delete into hook_nodeapi() as the $a3 parameter.
2. Create another type of operation for $op called something like "pre delete" or "to delete".
I think that making an adjustment like this can greatly enhance archiving modules and pre-deletion functionality. The way to do archiving of data as it stands now is for each creation of a node or node revision, save a copy of that creation/revision into another table. If a "pre deletion" operation were added, it could make archiving data far easier and far more efficient because all you'd need to do is copy the node revisions and the node itself into another table-- which can be done in one or two database queries (on MySQL at least).
Just a thought...
Comments
Comment #1
mkalkbrennerI created patches for drupal 5 and 6 which address the same issue.
See #287063: node_delete "leaks memory" due to deleted nodes cached
Comment #2
marcingy commented