diff --git a/includes/form.inc b/includes/form.inc index a337b03..1348590 100644 --- a/includes/form.inc +++ b/includes/form.inc @@ -993,6 +993,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'; @@ -1005,6 +1007,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';