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.
| Comment | File | Size | Author |
|---|---|---|---|
| #1 | revisoning-synchronize_new_node_status-1585630-1.patch | 915 bytes | pbuyle |
Comments
Comment #1
pbuyle commentedHere is a patch implementing the proposed resolution.
Comment #2
peter.thorndycraft commentedAfter 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
Comment #3
rdeboer$node->revision_moderationis a boolean, so not sure about the constant REVISIONING_MODERATED.I believe the code for newly created nodes should be:
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.
Comment #5
hanskuiters commentedWorks for me. Thanks.
Comment #6
rdeboerok!
Comment #6.0
rdeboerFix markup error