Hi (again :))

I've just been testing the latest 7.x-1.x dev branch as I am keen to update to it. I've found an issue though where if a node is published, then edited and saved again, the newly created (unpublished) revision has it's status set to 1 in the database. This means things like the latest published revision filter in views doesn't work etc.

Please see screenshot for the settings I have on the content type.

Note: if I revert back to my previous version of revisioning, I get correctly behaving revision statuses.

Let me know if you need any more info.

Cheers,
Adam

CommentFileSizeAuthor
revisioning-options.png54.3 KBacbramley

Comments

acbramley’s picture

I would think this is almost certainly due to this code in revisioning_node_presave().

  if (!empty($node->revision_moderation) && revisioning_user_may_auto_publish($node)) {
    revisioning_set_status_message(t('Auto-publishing this revision.'));
    // Follow the default saving process making this revision current and
    // published, as opposed to pending.
    unset($node->revision_moderation);
    // This is not required for correct operation, as a revision becomes
    // pending based on vid > current_revision_id. But it looks less confusing,
    // when the "Published" box is in sync with the moderation radio buttons.
    $node->status = NODE_PUBLISHED;
    $node->auto_publish = TRUE;
  } 
acbramley’s picture

Hmmm, on second thought probably not as auto publish is turned off for this content type.

acbramley’s picture

Possibly caused by

  if (isset($node->current_status)) {
    $node->status = $node->current_status; 
  }

in revisioning_node_update()?

rdeboer’s picture

Will work on this this weekend.

rdeboer’s picture

Assigned: Unassigned » rdeboer
Status: Active » Fixed

Hi Adam,
Revisioning does not (or no longer) update the status flag on the {node_revision} table. Core does that, but it doesn't do anything with it. The status flag on the {node}, rather than the {node_revision} table determines whether the content revision pointed to from the node is published or not.
The status on the {node_revision} table is just a reflection of the status the node had when the revision was created. But I don't believe it is used for any purpose in D7. Maybe there are plans to use it in D8, I don't know.

Anyway, I had a look at the filters 'Content revision: latest' and 'Content revision: latest published' and found that they were broken due to recent changes in Views 3.x.
So I've fixed them and also made them optionally exposed.
See how you go.
Rik

Disclaimer: these two filter are for 'Content revision' Views only. While they come up as options for 'Content' Views, they won't work.

acbramley’s picture

Awesome that worked :)

rdeboer’s picture

:-)

Status: Fixed » Closed (fixed)

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