summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorwebchick <webchick@24967.no-reply.drupal.org>2011-07-04 10:11:28 -0700
committerwebchick <webchick@24967.no-reply.drupal.org>2011-07-04 10:11:28 -0700
commit1046f0f2de5c663cf2c573ab086d957255367357 (patch)
tree7bc836e319daf760490a4daf3587c4d2c193e27c
parent1942cb4d0be394c1ae4bf61428bee802c92857dd (diff)
downloadbrdo-1046f0f2de5c663cf2c573ab086d957255367357.tar.gz
brdo-1046f0f2de5c663cf2c573ab086d957255367357.tar.bz2
Issue #1162022 by sun: Ensure #validate and #submit keys always exist in drupal_prepare_form().
-rw-r--r--includes/form.inc4
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';