Community

How best to test whether a node has any active revisions ?

I'm hoping to test whether a node has any revisions associated ( not whether it is enabled for revisions ). I was hoping that nid & vid would be equal no no revision exists but life is never thay simple.

Any suggestions appreciated.

Comments

node_revision_list($node); tr

node_revision_list($node);
try this function which will return an associative array keyed by node revision number.

For further reference see

http://api.drupal.org/api/drupal/modules%21node%21node.module/function/n...

Need Drupal help?
Reach Me
Drupal Developer , Themer.

Perfect. The only thing I

Perfect. The only thing I note is that this returns even unpublished node revision ids and some workflows ( not mine though ) queue revisions unpublished for moderation.

I used PHP's count() to see whether more than one vid exists.

Thanks

nobody click here