Steps:
1) Create a content page, text: 123 and publish
2) Edit the page, change text to: 456, and submit for moderation (no publish)
3) Click on Revisions
4) Click on the latest unpublished revision. Should show "456"...only shows currently published version (123).

Comments

rdeboer’s picture

Well if this is really the case then Revisioning is seriously broken for the thousands of users it has...

Naturally I cannot reproduce this, as for me the module works fine. To get to the bottom of this, some more info would be welcome.

In what role was the user who did steps 1) to 4) ? Was it superadmin uid=1 or some other role?
Was "administer content" permission ticked or not ticked (unticked is best) for this role?
Was "New revision in draft, pending moderation" ticked for the content type?
At the bottom of the page .../admin/config/content/revisioning what modules does it mention in "Additonal info" section? Just "node, revisioning"?

Tim-Erwin’s picture

Hi, I've got the same / a similar issue. I have revisioning with display/edit the latest revision. Edit the latest works fine, view does not although I'm admin. To be more specific: A user on my site created a node, made a few changes and saved a few times producing a bunch of revisions all "in draft/pending publication [status=0]". The first revision says "archived [status=0]" and is the one that is displayed when viewing the node (again: all permissions set plus I'm admin anyways). Why is the first revision archived? Is this the expected behavior? I hope not...

rdeboer’s picture

Hi Tim
Thanks for your query.
It is called archived because it isn't published.
However all revisions live in the same db table and you can revert to any of them and make that the currently published one.
Rik

Tim-Erwin’s picture

Thanks, Rik! The point is, _none_ of the revisions is published. Even the first one has not been published. That's why I am confused it's called "archived". Why do I get the latest revision when I click "edit" but not when viewing a node?
Hope, that makes it clearer
Tim

rdeboer’s picture

It's because even though none of the revisions are published Drupal still has a concept of the "current" revision: for referential integrity reasons it has to point to something, to some revision. When you view a node you get what it is pointing to, this "current" revision, which in your case is still unpublished.
Once you published the revision of your choice and look at that same screen again, colours will have changed and it will all make sense...

As far as the Edit button is concerned, you can configure whether is should go to the latest or to the "current" on the Revisioning configuration page.

Tim-Erwin’s picture

I can fully understand the whole concept you explained (worked with this for years), thanks, that's how I thought it should work. Let me go deeper into two spots of your answer:

When you view a node you get what it is pointing to, this "current" revision, which in your case is still unpublished.

Remember, the initial situation is, that we have a bunch of unpublished revisions. Now, why is the most outdated of them the "current", not the ...erm... current / most recent one?

you can configure whether is should go to the latest or to the "current" on the Revisioning configuration page.

So even if I accept that "current" points to the first revision created as long as there is no published one, why does the "latest" also give me that first revision? The setting changes nothing in that situation. I don't think that's right that way.

Tim-Erwin’s picture

Well, I found the problem. First of all: in principle the revisioning module works exactly as I thought it should. So we had kind of a miscommunication here, sorry. The problem on my system is the page manager module that creates a competing entry in the menu_router table:

path: node/%/view
access_callback: _revisioning_view_edit_access_callback
page_callback: page_manager_node_view_page

Hence, the revisioning node view callback _revisioning_view() is not called any more and the view latest / current setting has no effect any more.

Is there a way to circumvent that in order to use both modules (revisioning and page manager) together?

rdeboer’s picture

Title: Revisioning not showing selected version when viewing » Revisioning and PageManager not playing ball

Thanks for persisting with Revisioning!
And thanks for reporting the clash with Page Manager.
I guess there can only be one page call back. So either Page Manager has to learn about Revisioning or the other way around. Either way is likely to be a hacky solution involving
...if (module_exists(".....")) {....

Tim-Erwin’s picture

Category: bug » feature
Status: Active » Needs review

Hi, merlinofchaos pointed out how to integrate the two modules. I added the necessary hook and tested, it works perfectly. Please add the following to the revisioning module:

/**
 * Implements hook_page_manager_override().
 */
function revisioning_page_manager_override($task_name) {
  switch ($task_name) {
    case 'node_view':
      return '_revisioning_view';
  }
}

(I used switch so it's more easily extended. Semantically seems the preferrable thing to do. Don't mind if you change it to an if statement.)

rdeboer’s picture

Assigned: Unassigned » rdeboer
Status: Needs review » Needs work

Who would argue with The Merlin? ;-)

Thanks for doing the research and for merlinofchaos pointing out this very elegant solution (no "if (module_exists(...)) !") .
I did not know about this hook.

Will add ASAP!

Thanks again Tim & Miles,

Rik

mhenman’s picture

I was having this same issue, both "View latest" and "Edit latest" would never edit the latest, only the last published. I added the code from #9 above to the revisioning module and that fixed the "View latest" but not "Edit latest". Looking through the page manager module code, the node view task checks for and calls hook_page_manager_override, however the node edit task does not.

I will add an issue to chaos_tools to add hook_page_manager_override to the node edit task.

As another work around, you can go to admin/structure/pages and disable the following two entries:

System node_edit Node add/edit form /node/%node/edit
System node_view Node template /node/%node

May not work for others if your site depends on page manager handling these two, but it worked for me.

rdeboer’s picture

#11:

Thanks Mark,
For the comprehensive detective work and follow up.
Rik

rdeboer’s picture

Status: Needs work » Fixed

Patch from #9 applied. Thanks Tim-Erwin and thanks mhenman for the additional info.

Status: Fixed » Closed (fixed)

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