How to programmatically create new revision and publish it? (I am using Revisioning.) I call node_load(nid, vid) (with the latest version id), give new values to some fields, and then save the node. Setting $node-&gt;is_current = TRUE before saving will ensure that this version of the node is now published. However, it does not create a new revision. So I try setting $node-&gt;revision = TRUE also, but this creates a new unpublished revision which is not what I would expect.

How can I edit a node, and save it as a new revision and also as the current published revision? Not sure if it is a bug in the module.

// Node has some new revisions since the version that is currently published.
$vid = revisioning_get_latest_revision_id($nid);
$node = node_load($nid, $vid);
$node-&gt;revision = TRUE;
$node-&gt;is_current = TRUE;
$node-&gt;status = 1;
node_save($node);
// New revision created, but not published.
I think it will work when you explicitly set revision_moderation to FALSE. If moderation is not required, it should be published right away.

$vid = revisioning_get_latest_revision_id($nid);
$node = node_load($nid, $vid);
$node-&gt;revision = TRUE;
$node-&gt;is_current = TRUE;
$node-&gt;status = 1;
$node-&gt;revision_moderation = FALSE;
node_save($node);


From the example here: http://drupalprogrammatically.com/anwsers/7/create-node

Poster of above url also sets $node-&gt;revision = FALSE;, but that would give me the impression no new revision is saved, which is not what you want.
I hope it helps.