Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Working to schedule a node to programmatically move from draft to publish, doing like so:
$node = Node::load(3061);
//$node->set('moderation_state', "published");
//$node->save();
tends to just set the moderation state to published for the current published revision. Any insight into how to specifically identify the latest revision and publish that?
Comments
Comment #2
sandyjain CreditAttribution: sandyjain commentedHI,
I am also looking for the same.
Can anybody help here?
Thanks in advance.
Comment #3
jmtew58 CreditAttribution: jmtew58 commentedI am trying to make a 'bulk publish' function and also have need for this.
Thank you in advance!