summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorwebchick <webchick@24967.no-reply.drupal.org>2011-06-29 23:16:35 -0700
committerwebchick <webchick@24967.no-reply.drupal.org>2011-06-29 23:16:35 -0700
commit2c01d0549e7908cfd9fd94cd1343b6124610e6fe (patch)
tree2350e1b07e0c96e92f5e3b60c28500f35fec0b9d
parent2608c670ababfd04a4ce85393db7ebe4a0c14188 (diff)
downloadbrdo-2c01d0549e7908cfd9fd94cd1343b6124610e6fe.tar.gz
brdo-2c01d0549e7908cfd9fd94cd1343b6124610e6fe.tar.bz2
Issue #1049462 by rfay: Fixed Usage of deprecated form_state['clicked_button'] causes bugs during AJAX submissions by non-buttons.
-rw-r--r--includes/authorize.inc4
-rw-r--r--modules/field/field.form.inc4
-rw-r--r--modules/field_ui/field_ui.module2
-rw-r--r--modules/file/file.module2
-rw-r--r--modules/search/search.admin.inc4
-rw-r--r--modules/taxonomy/taxonomy.admin.inc8
6 files changed, 12 insertions, 12 deletions
diff --git a/includes/authorize.inc b/includes/authorize.inc
index 3617d7d03..852860413 100644
--- a/includes/authorize.inc
+++ b/includes/authorize.inc
@@ -193,7 +193,7 @@ function _authorize_filetransfer_connection_settings_set_defaults(&$element, $ke
function authorize_filetransfer_form_validate($form, &$form_state) {
// Only validate the form if we have collected all of the user input and are
// ready to proceed with updating or installing.
- if ($form_state['clicked_button']['#name'] != 'process_updates') {
+ if ($form_state['triggering_element']['#name'] != 'process_updates') {
return;
}
@@ -224,7 +224,7 @@ function authorize_filetransfer_form_validate($form, &$form_state) {
*/
function authorize_filetransfer_form_submit($form, &$form_state) {
global $base_url;
- switch ($form_state['clicked_button']['#name']) {
+ switch ($form_state['triggering_element']['#name']) {
case 'process_updates':
// Save the connection settings to the DB.
diff --git a/modules/field/field.form.inc b/modules/field/field.form.inc
index 845f04109..66d93e963 100644
--- a/modules/field/field.form.inc
+++ b/modules/field/field.form.inc
@@ -373,7 +373,7 @@ function field_default_form_errors($entity_type, $entity, $field, $instance, $la
* to return just the changed part of the form.
*/
function field_add_more_submit($form, &$form_state) {
- $button = $form_state['clicked_button'];
+ $button = $form_state['triggering_element'];
// Go one level up in the form, to the widgets container.
$element = drupal_array_get_nested_value($form, array_slice($button['#array_parents'], 0, -1));
@@ -398,7 +398,7 @@ function field_add_more_submit($form, &$form_state) {
* @see field_add_more_submit()
*/
function field_add_more_js($form, $form_state) {
- $button = $form_state['clicked_button'];
+ $button = $form_state['triggering_element'];
// Go one level up in the form, to the widgets container.
$element = drupal_array_get_nested_value($form, array_slice($button['#array_parents'], 0, -1));
diff --git a/modules/field_ui/field_ui.module b/modules/field_ui/field_ui.module
index 7355e879b..27ef3c2d7 100644
--- a/modules/field_ui/field_ui.module
+++ b/modules/field_ui/field_ui.module
@@ -358,7 +358,7 @@ function field_ui_form_node_type_form_alter(&$form, $form_state) {
* Redirect to manage fields form.
*/
function field_ui_form_node_type_form_submit($form, &$form_state) {
- if ($form_state['clicked_button']['#parents'][0] === 'save_continue') {
+ if ($form_state['triggering_element']['#parents'][0] === 'save_continue') {
$form_state['redirect'] = _field_ui_bundle_admin_path('node', $form_state['values']['type']) .'/fields';
}
}
diff --git a/modules/file/file.module b/modules/file/file.module
index 3e4525119..83de0f622 100644
--- a/modules/file/file.module
+++ b/modules/file/file.module
@@ -533,7 +533,7 @@ function file_managed_file_validate(&$element, &$form_state) {
// If referencing an existing file, only allow if there are existing
// references. This prevents unmanaged files from being deleted if this
// item were to be deleted.
- $clicked_button = end($form_state['clicked_button']['#parents']);
+ $clicked_button = end($form_state['triggering_element']['#parents']);
if ($clicked_button != 'remove_button' && !empty($element['fid']['#value'])) {
if ($file = file_load($element['fid']['#value'])) {
if ($file->status == FILE_STATUS_PERMANENT) {
diff --git a/modules/search/search.admin.inc b/modules/search/search.admin.inc
index afa02defb..d93c85288 100644
--- a/modules/search/search.admin.inc
+++ b/modules/search/search.admin.inc
@@ -143,7 +143,7 @@ function search_admin_settings($form) {
*/
function search_admin_settings_validate($form, &$form_state) {
// Check whether we selected a valid default.
- if ($form_state['clicked_button']['#value'] != t('Reset to defaults')) {
+ if ($form_state['triggering_element']['#value'] != t('Reset to defaults')) {
$new_modules = array_filter($form_state['values']['search_active_modules']);
$default = $form_state['values']['search_default_module'];
if (!in_array($default, $new_modules, TRUE)) {
@@ -164,7 +164,7 @@ function search_admin_settings_submit($form, &$form_state) {
}
$current_modules = variable_get('search_active_modules', array('node', 'user'));
// Check whether we are resetting the values.
- if ($form_state['clicked_button']['#value'] == t('Reset to defaults')) {
+ if ($form_state['triggering_element']['#value'] == t('Reset to defaults')) {
$new_modules = array('node', 'user');
}
else {
diff --git a/modules/taxonomy/taxonomy.admin.inc b/modules/taxonomy/taxonomy.admin.inc
index d83f5d367..b0bb2a175 100644
--- a/modules/taxonomy/taxonomy.admin.inc
+++ b/modules/taxonomy/taxonomy.admin.inc
@@ -209,7 +209,7 @@ function taxonomy_form_vocabulary_validate($form, &$form_state) {
* @see taxonomy_form_vocabulary_validate()
*/
function taxonomy_form_vocabulary_submit($form, &$form_state) {
- if ($form_state['clicked_button']['#value'] == t('Delete')) {
+ if ($form_state['triggering_element']['#value'] == t('Delete')) {
// Rebuild the form to confirm vocabulary deletion.
$form_state['rebuild'] = TRUE;
$form_state['confirm_delete'] = TRUE;
@@ -434,7 +434,7 @@ function taxonomy_overview_terms($form, &$form_state, $vocabulary) {
* @see taxonomy_overview_terms()
*/
function taxonomy_overview_terms_submit($form, &$form_state) {
- if ($form_state['clicked_button']['#value'] == t('Reset to alphabetical')) {
+ if ($form_state['triggering_element']['#value'] == t('Reset to alphabetical')) {
// Execute the reset action.
if ($form_state['values']['reset_alphabetical'] === TRUE) {
return taxonomy_vocabulary_confirm_reset_alphabetical_submit($form, $form_state);
@@ -801,7 +801,7 @@ function taxonomy_form_term_validate($form, &$form_state) {
* @see taxonomy_form_term()
*/
function taxonomy_form_term_submit($form, &$form_state) {
- if ($form_state['clicked_button']['#value'] == t('Delete')) {
+ if ($form_state['triggering_element']['#value'] == t('Delete')) {
// Execute the term deletion.
if ($form_state['values']['delete'] === TRUE) {
return taxonomy_term_confirm_delete_submit($form, $form_state);
@@ -812,7 +812,7 @@ function taxonomy_form_term_submit($form, &$form_state) {
return;
}
// Rebuild the form to confirm enabling multiple parents.
- elseif ($form_state['clicked_button']['#value'] == t('Save') && count($form_state['values']['parent']) > 1 && $form['#vocabulary']->hierarchy < 2) {
+ elseif ($form_state['triggering_element']['#value'] == t('Save') && count($form_state['values']['parent']) > 1 && $form['#vocabulary']->hierarchy < 2) {
$form_state['rebuild'] = TRUE;
$form_state['confirm_parents'] = TRUE;
return;