I had drupal_execute working under Drupal 5.x, but am having trouble getting it to work under Drupal 6.
Under 5.x, drupal_execute worked like this :
$node = array('type' => 'mynodetype');
drupal_execute($form_id, $form_values, $node);
Under 6.x I'm trying this :
$node = array('type' => 'mynodetype');
// a number of lines to setup form_state
drupal_execute('mynodetype_form', $form_state, $node); // this inserts node
I also tried to simply copy and past the sample from the Drupal 6 API docs but this didn't work :
$form_state = array();
$node = array('type' => 'story');
$form_state['values']['title'] = 'My node';
$form_state['values']['body'] = 'This is the body text!';
$form_state['values']['name'] = 'robo-user';
$form_state['values']['op'] = t('Save');
drupal_execute('story_node_form', $form_state, $node);
The Drupal 6 API docs state this :
drupal_execute($form_id, &$form_state)
I guess I'm not clear what the form_id is. Can anyone offer some guidance on this?
Thanks,
David
Comments
I'm inserting directly into db
I couldn't figure out drupal_execute. For the moment I'm just inserting directly into the database. Not flexible, and probably not recommended, but it works for now.
hedge funds credit cards
income taxes debt relief
Solution
See this thread.
http://www.universalpantograph.com
that thread no good
that thread no good
it is for drpal 5.x
i have the same problem! in
i have the same problem!
in this code , what does '#type' => 'gmap' mean?
it can run in drupal5,but can not run in drupal6. why not?
thanks a lot!
---------------------------------------------------------------------------
Women Lose Weight-->I would love to lose weight!
i have the same problem! in
i have the same problem!
in this code , what does '#type' => 'gmap' mean?
it can run in drupal5,but can not run in drupal6. why not?
thanks a lot!
---------------------------------------------------------------------------
Women Lose Weight-->I would love to lose weight!
i have the same problem! in
i have the same problem!
in this code , what does '#type' => 'gmap' mean?
it can run in drupal5,but can not run in drupal6. why not?
thanks a lot!
---------------------------------------------------------------------------
Women Lose Weight-->I would love to lose weight!
Have you been able to solve
Have you been able to solve this? I'm having the same problem...
Node should be an object
Probably the last line should read:
drupal_execute('story_node_form', $form_state, (object)$node);