- πͺπΈSpain juampynr
For reference, in Workbench Moderation 7.x-2.x-dev, this worked to me to unpublish a node:
$node = node_load(218821); $node->status = NODE_NOT_PUBLISHED; $node->event = 'to_unpublished'; node_save($node);
I am trying very hard to figure out how to set the state of nodes during a views bulk operation custom action I have created. I suppose I could manually set the ->state_flow->current and do a node save for each item, but I am not sure that this will then fire my "After a State Flow Event occurs" event to cause my rules to be obeyed.
What method/function would I use in this 7.x-2.x-dev branch to set the state of the node so that this state flow event will be fired?
Fixed
2.0
Code
Not all content is available!
It's likely this issue predates Contrib.social: some issue and comment data are missing.
For reference, in Workbench Moderation 7.x-2.x-dev, this worked to me to unpublish a node:
$node = node_load(218821);
$node->status = NODE_NOT_PUBLISHED;
$node->event = 'to_unpublished';
node_save($node);