The variable $row->number_of_revisions is listed as available and it is empty; a print_r($row) also returns no value:

stdClass Object ( [vid] => 45183 [number_of_revisions] => [title] => nodetitle

The field itself has a value; it has a token I can use to rewrite the text of other fields; but I need to perform a mathematical calculation on the vid + [number_of_revisions] -1 to construct a link to the ultimate revision; Views fails to do that in D6 (even when filtering for the latest revision) and it could be an issue with Revisioning

I am pondering writing a custom query in the PHP field to count the revisions, but that's frustrating since the count already exists as a field in the view.

Comments

decibel.places’s picture

In the PHP Field Output field:

<?php 
$vquery = "SELECT COUNT(node_revisions.vid) AS value
 FROM node_revisions 
 WHERE node_revisions.nid = $row->nid";
 $vresult = db_query($vquery);
 $vrow = db_fetch_object($vresult);
$static = $vrow->value;
$revnum = $row->vid + $static - 1;
$rnid = $row->nid;
$rstring = "/node/" . $rnid . "/revisions/" . $revnum . "/view";
echo '<a href=' . $rstring . '>Revision</a>';
?>
liam morland’s picture

Issue summary: View changes
Status: Active » Closed (outdated)

Drupal 6 is no longer supported. If this applies to a later version, please re-open and update the version.