3

I am using workbench_moderation module.

When I edit the node and save it using node_save($node) it is changing the status of actual node to draft and original node is getting unpublished.

While I want to keep original node as published and want to create new reversion in draft status.

I used below code too but it is not working form me(It is immediately publishing my changes).

node_save($node);
workbench_moderation_moderate($node, 'published');
2
  • new reversion or new revision?
    – Jimmy Ko
    Jul 30, 2016 at 16:53
  • Are you sure no other code is executed by custom module or rules? How about checking the publishing status after node_save($node)?
    – Justme
    Jun 15, 2018 at 18:55

1 Answer 1

0

I've not tested or checked against the source code but I think you should try to node_load after node_save and before workbench_moderation_moderate.

node_save($node);
$saved_node = node_load($node->nid);
workbench_moderation_moderate($saved_node, 'published');

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.