Hi. You have to pass another variable to drupal_execute, with node information. If I remember well it should be like this:
$form_id = 'blog_node_form'; $form['values'] = array( 'title' => 'pippo', 'taxonomy[tags][3]' => 'prova', 'body' => 'Io sono il corpo del messaggio', 'format' => 1, 'field_old_id[0][value]' => '11', 'name' => 'wheel',
'type' =>"your-type" // eg. story
);
$k = drupal_execute($form_id,$form, $form);
Hope it works.
Saluti, Luca
Davide Michel 'ZioBudda' Morelli ha scritto:
Hi all. I need to import some blog's node from another site. I have tried this:
$form_id = 'blog_node_form'; $form['values'] = array( 'title' => 'pippo', 'taxonomy[tags][3]' => 'prova', 'body' => 'Io sono il corpo del messaggio', 'format' => 1, 'field_old_id[0][value]' => '11', 'name' => 'wheel' );
$k = drupal_execute($form_id,$form);Field_old_id is a cck's field.
When I try to run this code Drupal return me this error: warning: call_user_func_array() [function.call-user-func-array http://distrofici/admin/zblabs/function.call-user-func-array]: First argument is expected to be a valid callback, 'node_form' was given in /home/michel/LAVORI_ZB/www/distrofici/includes/form.inc on line 366.
Where is my error ?
Tnx.
-- Michel 'ZioBudda' Morelli michel@ziobudda.net Consulenza sistemistica in ambito OpenSource. Sviluppo applicazioni web dinamiche (LAMP+Ajax) Telefono: 0200619074 Telefono Cell: +39-3939890025 -- Fax: +39-0291390660
http://www.ziobudda.net ICQ: 58351764 http://www.ziobuddalabs.it Skype: zio_budda http://www.ziodrupal.net MSN: michel@ziobuddalabs.it JABBER: michel@ziobuddalabs.it