drupal_execute dans drupal 6(Unsupported operand types...)

Catégories:

J’ai un probleme lors que je veux enregistrer un cck en utilisant la function drupal_execute.

J’ai le message d’erreur suivant :
Fatal error : Unsupported operand types in /home/workspace/test/includes/form.inc on line 511

Pourtant j’utilise l’exemple de l’api de drupal 6 à savoir :

<?php
// Create a new node $form_state = array();
module_load_include('inc', 'node', 'node.pages');
$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, (object)$node);

?>

http://api.drupal.org/api/function/drupal_execute/6

ma version de php est PHP Version 5.2.6-2ubuntu4.1

Quelqu’un a deja eu ce probleme ?

#

up

Syndiquer le contenu