Problem

After upgrading from 7.x-1.3 to 7.x-1.4, new content are always published or unpublished according to the
default publishing option for the content type. The selected revision creation and moderation option has no impact on this. So when creating a new node of a content type published by default, the node is published on creation even when the "Create new revision and moderate" option is selected. And because Revisioning hide the "Published" checkbox, there is now no way to create an unpublished node.

Proposed resolution

In the 7.x-1.4 the code in revisioning_node_presave() never set $node->status to NODE_NOT_PUBLISHED. And only sets it to NODE_PUBLISHED when autopublished.

In the 7.x-1.3 release, it was set to NODE_PUBLISHED only when auto-published and to NODE_NOT_PUBLISHED if not.

Both behaviours seems wrong. To keep the published status of the node in sync with the only revision of a new node, $node->status should be set to ($node->revision_moderation == REVISIONING_MODERATED) ? NODE_NOT_PUBLISHED : NODE_PUBLISHED when not auto-published.

Comments

pbuyle’s picture

Here is a patch implementing the proposed resolution.

peter.thorndycraft’s picture

After using the above patch, the constant REVISIONING_MODERATED is not defined. Could I suggest that it is added to the other defines in the module file.

Peter

rdeboer’s picture

Assigned: Unassigned » rdeboer
Status: Active » Fixed

$node->revision_moderation is a boolean, so not sure about the constant REVISIONING_MODERATED.

I believe the code for newly created nodes should be:

  if (!isset($node->nid)) {
    // New node, if moderated and without Auto-publish, ignore the default Publish tickbox
    if (isset($node->revision_moderation) && $node->revision_moderation == TRUE) {
      $node->status = NODE_NOT_PUBLISHED;
    }
    return;
  }

That is, the default Publish status on the content type for a NEW node is overridden ONLY when ""Create new revision and moderate" is ticked.

Checked into the dev branch.

Status: Fixed » Closed (fixed)

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

hanskuiters’s picture

Works for me. Thanks.

rdeboer’s picture

ok!

rdeboer’s picture

Issue summary: View changes

Fix markup error