2014-08-29 53 views

回答

7

我只是自己有這個問題。關鍵的事情:

  • 內容類型正在審覈通過工作臺節制模塊
  • 設置新的中庸狀態
  • 設置節點作爲一個新的版本

的Drupal需要的護理休息。

<?php 
$node = node_load($nid); 
$node->body[LANGUAGE_NONE][0]['value'] = 'My new body content'; 
// We're wanting drupal to create a new revision 
$node->revision = 1; 
// We want workbench moderation to treat the new revision as a new draft 
$node->workbench_moderation_state_new = workbench_moderation_state_none(); 
node_save($node); 

這是目前在我的代碼庫中工作。

+1

非常感謝!我開始擔心Workbench Moderation負責修改。但它是'$ node-> revision = 1;'這就是我正在尋找的魔法。 – 2014-09-05 05:22:37

+0

這也是我抓到的東西。 :) – Gold 2014-09-08 23:19:55

相關問題