(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->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->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->revision = TRUE; $node->is_current = TRUE; $node->status = 1; node_save($node); // New revision created, but not published.