I am using Workbench Moderation module for moderation on nodes. I notice that it creates revision of the nodes.
I have a node which is in live/publish state therefore it is available for the site visitors. Then when an editor edit that node, I programmatically put that node in needs review state and create a new revision for that node.
After that the site visitors are not able to access that node until its state change to publish.
I want that the new revision should be needs review state and the previous publish revision of the node should be available to site visitors.
The code which I am using for setting the state of the node is as following.
$node->status = 0; $node->revision = 1; node_save($node); workbench_moderation_moderate($node, 'needs_review');