diff options
-rw-r--r-- | includes/form.inc | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/includes/form.inc b/includes/form.inc index 2dffe84cb..c2495e222 100644 --- a/includes/form.inc +++ b/includes/form.inc @@ -995,6 +995,8 @@ function drupal_prepare_form($form_id, &$form, &$form_state) { $form += array('#tree' => FALSE, '#parents' => array()); if (!isset($form['#validate'])) { + // Ensure that modules can rely on #validate being set. + $form['#validate'] = array(); // Check for a handler specific to $form_id. if (function_exists($form_id . '_validate')) { $form['#validate'][] = $form_id . '_validate'; @@ -1007,6 +1009,8 @@ function drupal_prepare_form($form_id, &$form, &$form_state) { } if (!isset($form['#submit'])) { + // Ensure that modules can rely on #submit being set. + $form['#submit'] = array(); // Check for a handler specific to $form_id. if (function_exists($form_id . '_submit')) { $form['#submit'][] = $form_id . '_submit'; |