0
我查找代碼並嘗試過,但它似乎並沒有保存數據庫中的field_units變量。任何幫助都將非常有幫助。自定義字段node_save Drupal 7
global $count,$user;
try
{
$node = new stbClass();
$node -> type = 'Quote';
$node -> title = 'Quote Detail';
$node -> language = LANGUAGE_NONE;
$node -> path = array('alias' => 'quote_detial_node_form/'. $form_state['values']['field_data_field_units']);
node_object_prepare($node);
$node->uid = $user->uid;
$node->is_new = True;
$node->comment = 0;
$node->promote = 0;
$node->field_units['und'][0]['value'] = 'Row_quantity';
$node->created = time();
$node->changed = $node->created;
node_submit($node);
node_save($node);
throw new Exception('Error Processing Request');
}