我想进行批量操作并将节点从“草稿”状态更改为“已发布”。我根据先前的更改创建了一个新修订,但是所有修订默认为“草稿”。现在,我想基本上只是发布新修订版。(我正在使用工作台模块。)
我已经尝试过执行以下操作,但是似乎都没有用:
$node->workbench_moderation['current']->published = "1";
要么
$node->workbench_moderation['current']->from_state = "draft";
$node->workbench_moderation['current']->state = "published";
$node->workbench_moderation['current']->published = "1";
$node->workbench_moderation['published']->from_state = "draft";
$node->workbench_moderation['published']->state = "published";
$node->workbench_moderation['published']->published = "1";
$node->workbench_moderation['my_revision']->from_state = "draft";
$node->workbench_moderation['my_revision']->state = "published";
$node->workbench_moderation['my_revision']->published = "1";
$node->workbench_moderation['my_revision']->current = TRUE;
要么
workbench_moderation_moderate($node, 'published');
我尝试使用以下内容而不是保存内容node_save
,以为可能node_save
触发了新草案。
workbench_moderation_node_update($node);
我只想简单地加载节点,发布草稿,然后再次保存。
知道我在做什么错吗?