diff -u b/core/includes/form.inc b/core/includes/form.inc --- b/core/includes/form.inc +++ b/core/includes/form.inc @@ -1169,7 +1169,7 @@ // allow the value of the clicked button to be retained in its normal // $form_state['values'] locations, even if these locations are not included // in #limit_validation_errors. - if (isset($form_state['triggering_element']['#button_type'])) { + if (!empty($form_state['triggering_element']['#is_button'])) { $button_value = $form_state['triggering_element']['#value']; // Like all input controls, the button value may be in the location @@ -1947,7 +1947,7 @@ } // Special processing if the triggering element is a button. - if (isset($form_state['triggering_element']['#button_type'])) { + if (!empty($form_state['triggering_element']['#is_button'])) { // Because there are several ways in which the triggering element could // have been determined (including from input variables set by JavaScript // or fallback behavior implemented for IE), and because buttons often @@ -2083,7 +2083,7 @@ // If the form was submitted by the browser rather than via Ajax, then it // can only have been triggered by a button, and we need to determine which // button within the constraints of how browsers provide this information. - if (isset($element['#button_type'])) { + if (!empty($element['#is_button'])) { // All buttons in the form need to be tracked for // form_state_values_clean() and for the form_builder() code that handles // a form submission containing no button information in $_POST. @@ -3925,7 +3925,7 @@ * @param $variables * An associative array containing: * - element: An associative array containing the properties of the element. - * Properties used: #attributes, #button_type, #button_class, #name, #value. + * Properties used: #attributes, #button_type, #name, #value. * * @ingroup themeable */ @@ -3935,8 +3935,8 @@ element_set_attributes($element, array('id', 'name', 'value')); $element['#attributes']['class'][] = 'form-button'; - if (!empty($element['#button_class'])) { - $element['#attributes']['class'][] = 'form-button-' . $element['#button_class']; + if (!empty($element['#button_type'])) { + $element['#attributes']['class'][] = 'form-button-' . $element['#button_type']; } else { $element['#attributes']['class'][] = 'form-submit'; @@ -3954,8 +3954,7 @@ * @param $variables * An associative array containing: * - element: An associative array containing the properties of the element. - * Properties used: #attributes, #button_type, #button_class, #name, - * #value, #title, #src. + * Properties used: #attributes, #button_type, #name, #value, #title, #src. * * @ingroup themeable */ @@ -3971,8 +3970,8 @@ } $element['#attributes']['class'][] = 'form-button'; - if (!empty($element['#button_class'])) { - $element['#attributes']['class'][] = 'form-button-' . $element['#button_class']; + if (!empty($element['#button_type'])) { + $element['#attributes']['class'][] = 'form-button-' . $element['#button_type']; } else { $element['#attributes']['class'][] = 'form-submit'; diff -u b/core/lib/Drupal/Core/Entity/EntityFormController.php b/core/lib/Drupal/Core/Entity/EntityFormController.php --- b/core/lib/Drupal/Core/Entity/EntityFormController.php +++ b/core/lib/Drupal/Core/Entity/EntityFormController.php @@ -99,12 +99,12 @@ $delete = $element['delete']; unset($element['delete']); $element['delete'] = $delete; - $element['delete']['#button_class'] = 'delete'; + $element['delete']['#button_type'] = 'delete'; } if (isset($element['submit'])) { - // Give the primary submit button a #button_class of primary. - $element['submit']['#button_class'] = 'primary'; + // Give the primary submit button a #button_type of primary. + $element['submit']['#button_type'] = 'primary'; } $count = 0; only in patch2: unchanged: --- a/core/includes/ajax.inc +++ b/core/includes/ajax.inc @@ -631,7 +631,7 @@ function ajax_pre_render_element($element) { // If the element is a (non-image) button, its name may not identify it // uniquely, in which case a match on value is also needed. // @see _form_button_was_clicked() - if (isset($element['#button_type']) && empty($element['#has_garbage_value'])) { + if (!empty($element['#is_button']) && empty($element['#has_garbage_value'])) { $settings['submit']['_triggering_element_value'] = $element['#value']; } } only in patch2: unchanged: --- a/core/modules/system/system.module +++ b/core/modules/system/system.module @@ -300,7 +300,7 @@ function system_element_info() { $types['submit'] = array( '#input' => TRUE, '#name' => 'op', - '#button_type' => 'submit', + '#is_button' => TRUE, '#executes_submit_callback' => TRUE, '#limit_validation_errors' => FALSE, '#process' => array('form_process_button', 'ajax_process_form'), @@ -309,7 +309,7 @@ function system_element_info() { $types['button'] = array( '#input' => TRUE, '#name' => 'op', - '#button_type' => 'submit', + '#is_button' => TRUE, '#executes_submit_callback' => FALSE, '#limit_validation_errors' => FALSE, '#process' => array('form_process_button', 'ajax_process_form'), @@ -317,7 +317,7 @@ function system_element_info() { ); $types['image_button'] = array( '#input' => TRUE, - '#button_type' => 'submit', + '#is_button' => TRUE, '#executes_submit_callback' => TRUE, '#limit_validation_errors' => FALSE, '#process' => array('form_process_button', 'ajax_process_form'), only in patch2: unchanged: --- a/core/modules/views/views_ui/admin.inc +++ b/core/modules/views/views_ui/admin.inc @@ -2303,7 +2303,7 @@ function views_fetch_fields($base, $type, $grouping = FALSE, $sub_type = NULL) { */ function views_ui_form_button_was_clicked($element, &$form_state) { $process_input = empty($element['#disabled']) && ($form_state['programmed'] || ($form_state['process_input'] && (!isset($element['#access']) || $element['#access']))); - if ($process_input && !isset($form_state['triggering_element']) && isset($element['#button_type']) && isset($form_state['input'][$element['#name']]) && isset($element['#values']) && in_array($form_state['input'][$element['#name']], $element['#values'], TRUE)) { + if ($process_input && !isset($form_state['triggering_element']) && !empty($element['#is_button']) && isset($form_state['input'][$element['#name']]) && isset($element['#values']) && in_array($form_state['input'][$element['#name']], $element['#values'], TRUE)) { $form_state['triggering_element'] = $element; } return $element;