Hi all

I can not save be selected taxonomy term when I submit this form, but i can success save the 'title', 'body' values; any tips will be thankful.

/** add article node/add form **/
function modulename_article() {
return drupal_get_form('modulename_article_form');
}

function modulename_article_form() {
$form['title'] = array(
'#type' => 'textfield',
'#title' => 'article',
'#size' => 30,
);

$form['body'] = array(
'#type' => 'textarea',
'#title' => 'body',
'#size' => 30,
);

$form['taxonomy'] = taxonomy_form(6);

$form['submit'] = array(
'#type' => 'submit',
'#value' => 'Post',
);

return $form;
}

function modulename_article_form_submit($form_id, $form) {
global $user;

$form_state = array();
module_load_include('inc', 'node', 'node.pages');

$node = array('type' => 'article');

$form_state['values']['taxonomy'] = $form['values']['taxonomy'][1];

$form_state['values']['title'] = $form['values']['title'];
$form_state['values']['body'] = $form['values']['body'];
$form_state['values']['name'] = $user->name;
$form_state['values']['op'] = t('Save');

drupal_execute('article_node_form', $form_state, (object)$node);
}


    print modulename_article();

Comments

voxpelli’s picture

Status: Active » Postponed (maintainer needs more info)

How does this relate to Node form columns?

asherry’s picture

Issue summary: View changes
Status: Postponed (maintainer needs more info) » Closed (won't fix)