Closed (fixed)
Project:
Revisioning
Version:
7.x-1.0-alpha2
Component:
Code
Priority:
Major
Category:
Bug report
Assigned:
Reporter:
Created:
6 Apr 2011 at 20:17 UTC
Updated:
23 Apr 2011 at 00:02 UTC
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
Comment #1
ericras commentedIn 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.
Comment #2
rdeboerThanks for your report, eric. Will fix tonight.
Comment #3
rdeboerOk 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 D7node_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
Comment #4
rdeboerFixed 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.