From ab7fb8005696a519c82ec9e0a1b3b07960e8b60b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=A1bor=20Hojtsy?= Date: Sun, 3 Feb 2008 19:26:10 +0000 Subject: #216061 by Eaton: nid was not set in node creation (programatic node creation regression) --- includes/form.inc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'includes') diff --git a/includes/form.inc b/includes/form.inc index 821101c0d..1ba20a14d 100644 --- a/includes/form.inc +++ b/includes/form.inc @@ -274,12 +274,13 @@ function form_set_cache($form_build_id, $form, $form_state) { * * // 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, $node); + * drupal_execute('story_node_form', $form_state, (object)$node); */ function drupal_execute($form_id, &$form_state) { $args = func_get_args(); -- cgit v1.2.3