In following the example for D7 on http://drupal.org/node/408968 when the Author edits an existing node (a 'policy' content type I created in my case) the new revision is instantly published without having been approved by the Moderator.

The revision list (/node/23/revisions) will look correct with the latest edit having status 'in draft/pending publication' and the previous revision status of 'current revision (published)' but the public anonymous view displays the draft revision.

Comments

ericras’s picture

Title: Anonymous view always displays latest revision » Anonymous view always displays latest revision's body

In using debug() I see that I was incorrect above.

For those with access (Moderator, Author) the following views display the revisions correctly:
/node/23/revisions/61/view (which is the 'in draft/pending publication' version)
/node/23/revisions/60/view (which is the 'current revision')

but when I dump out $node on /node/23 (for any role) it shows 'vid' => '60' which is correct but the 'body' being display is that of revision 61.

rdeboer’s picture

Thanks for your report, eric. Will fix tonight.

rdeboer’s picture

Ok I dug a bit deeper -- turns out it's bug in core, which I have just logged #1120272: node object inconsistent after node_load($nid).

node_load() in D6 by default loads the current revision whereas in D7 node_load() loads the latest revision. D7 then leaves the caller with an inconsistent $node object: it has the current revision vid, but it has the latest body, exactly as you, Eric, reported.

When a node doesn't have revisions or its current revision is always the latest, then the D6 and D7 approaches are equivalent, but that's not the use-case Revisioning is dealing with.
I will now go through the Revisioning code and put in fixes to work around the changed core behaviour.

Rik

rdeboer’s picture

Assigned: Unassigned » rdeboer
Status: Active » Fixed

Fixed in 7.x-1.0-alpha3 by working around the core problem mentioned above (i.e. #1120272: node object inconsistent after node_load($nid)).
Thanks Eric for supplying a core patch for 1120272 at the same time!
The 7.x-1.0-alpha3 release works with and without your core patch.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.