From b1026a1a21f689cafedc0408a3174edb61f85ee2 Mon Sep 17 00:00:00 2001 From: Angie Byron Date: Fri, 23 Apr 2010 07:50:28 +0000 Subject: #776178 follow-up by David_Rothstein: Fixed PHP 5.3 warning for command line install at the root, rather than the symptom. --- includes/form.inc | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) (limited to 'includes/form.inc') diff --git a/includes/form.inc b/includes/form.inc index fcadc3c36..4b8972a01 100644 --- a/includes/form.inc +++ b/includes/form.inc @@ -459,7 +459,20 @@ function form_state_keys_no_cache() { * Any additional arguments are passed on to the functions called by * drupal_form_submit(), including the unique form constructor function. * For example, the node_edit form requires that a node object be passed - * in here when it is called. + * in here when it is called. Arguments that need to be passed by reference + * should not be included here, but rather placed directly in the $form_state + * build info array so that the reference can be preserved. For example, a + * form builder function with the following signature: + * @code + * function mymodule_form($form, &$form_state, &$object) { + * } + * @endcode + * would be called via drupal_form_submit() as follows: + * @code + * $form_state['values'] = $my_form_values; + * $form_state['build_info']['args'] = array(&$object); + * drupal_form_submit('mymodule_form', $form_state); + * @endcode * For example: * @code * // register a new user -- cgit v1.2.3