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

chandan chaudhary’s picture

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

Acquia Certified Developer

Backend Frontend and DevOps.

El Bandito’s picture

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