diff options
author | Angie Byron <webchick@24967.no-reply.drupal.org> | 2010-07-10 00:03:37 +0000 |
---|---|---|
committer | Angie Byron <webchick@24967.no-reply.drupal.org> | 2010-07-10 00:03:37 +0000 |
commit | 0c993fd704dab80a845602a878bd612e9216b137 (patch) | |
tree | 67bb6773c148332592c1a9eb8a92bf4969bbaa3e /includes | |
parent | 28219f5999ba3bfc7aa2d5ad92159ef20825f42d (diff) | |
download | brdo-0c993fd704dab80a845602a878bd612e9216b137.tar.gz brdo-0c993fd704dab80a845602a878bd612e9216b137.tar.bz2 |
#776956 by CrashTest_, Damien Tournoud, effulgentsia, chx: Fixed critical bug: Complex widgets are not respecting '#disabled' state.
Diffstat (limited to 'includes')
-rw-r--r-- | includes/form.inc | 26 |
1 files changed, 11 insertions, 15 deletions
diff --git a/includes/form.inc b/includes/form.inc index b6732481e..b214b673c 100644 --- a/includes/form.inc +++ b/includes/form.inc @@ -1505,6 +1505,14 @@ function form_builder($form_id, $element, &$form_state) { $element[$key]['#access'] = FALSE; } + // Make child elements inherit their parent's #disabled and #allow_focus + // values unless they specify their own. + foreach (array('#disabled', '#allow_focus') as $property) { + if (isset($element[$property]) && !isset($element[$key][$property])) { + $element[$key][$property] = $element[$property]; + } + } + // Don't squash existing parents value. if (!isset($element[$key]['#parents'])) { // Check to see if a tree of child elements is present. If so, @@ -2522,12 +2530,8 @@ function form_process_radios($element) { '#attributes' => $element['#attributes'], '#parents' => $element['#parents'], '#id' => drupal_html_id('edit-' . implode('-', $parents_for_id)), + '#ajax' => isset($element['#ajax']) ? $element['#ajax'] : NULL, ); - foreach (array('#ajax', '#disabled', '#allow_focus') as $property) { - if (isset($element[$property])) { - $element[$key][$property] = $element[$property]; - } - } } } } @@ -2623,12 +2627,8 @@ function form_process_checkboxes($element) { '#return_value' => $key, '#default_value' => isset($value[$key]) ? $key : NULL, '#attributes' => $element['#attributes'], + '#ajax' => isset($element['#ajax']) ? $element['#ajax'] : NULL, ); - foreach (array('#ajax', '#disabled', '#allow_focus') as $property) { - if (isset($element[$property])) { - $element[$key][$property] = $element[$property]; - } - } } } } @@ -2808,13 +2808,9 @@ function form_process_tableselect($element) { '#attributes' => $element['#attributes'], '#parents' => $element['#parents'], '#id' => drupal_html_id('edit-' . implode('-', $parents_for_id)), + '#ajax' => isset($element['#ajax']) ? $element['#ajax'] : NULL, ); } - foreach (array('#ajax', '#disabled', '#allow_focus') as $property) { - if (isset($element[$property])) { - $element[$key][$property] = $element[$property]; - } - } } } } |