I was looking information on the revision system when I came across a comment from someone confused by the changes. In there they asked for node_example.module to be updated to demonstrate revisions. Thinking that was a good idea I started on it.

In the process I realized that it was kind of kludgy that you had to implement hook_nodeapi() to delete revisions. I'm working on a patch for that so I'm putting this aside for the moment.

Attached is a patch that adds revision support EXCEPT for deleting a single revision.

Comments

drewish’s picture

i've opened an issue to add a hook_delete_revision(): http://drupal.org/node/50627

drewish’s picture

Status: Needs work » Needs review
StatusFileSize
new5.75 KB

i finished up the patch, adding an implementation of hook_nodeapi(op=delete revision). please review the changes.

drewish’s picture

StatusFileSize
new5.79 KB

on irc, killes suggested that nid be indexed. rather than provide separate mysql/pgsql schemas i've just made vid, nid a joint primary key.

i should also mention, i've upated quite a bit of other code in the module to follow the current practices in core (with the exception of the long forms format). like, removing the hook_link implementation as it's handled by tabs now.

drewish’s picture

Status: Needs review » Fixed

i'm going to go ahead an commit this.

Anonymous’s picture

Status: Fixed » Closed (fixed)