Skip to content
Snippets Groups Projects
Commit c3514a3a authored by Ryan Szrama's avatar Ryan Szrama
Browse files

Issue #1354596 by rszrama: replace comparisons against ['values']['op'] with...

Issue #1354596 by rszrama: replace comparisons against ['values']['op'] with comparisons against the end() value of the triggering element's #array_parents array.
parent 9340c340
No related branches found
Tags 8.x-2.9
No related merge requests found
......@@ -315,7 +315,7 @@ function commerce_checkout_form_submit($form, &$form_state) {
}
// If the form was submitted via the continue button...
if ($form_state['values']['op'] == $form_state['values']['continue']) {
if (end($form_state['triggering_element']['#array_parents']) == 'continue') {
// If there is another checkout page...
if ($checkout_page['next_page']) {
// Update the order status to reflect the next checkout page.
......
......@@ -188,7 +188,7 @@ function commerce_payment_order_transaction_add_form_payment_terminal_validate($
function commerce_payment_order_transaction_add_form_validate($form, &$form_state) {
// If the button used to submit was not the "Add payment" button, give the
// payment method a chance to validate the input.
if ($form_state['values']['op'] != t('Add payment')) {
if (end($form_state['triggering_element']['#array_parents']) != 'add_payment') {
$payment_method = $form_state['payment_method'];
$order = $form_state['order'];
......@@ -204,7 +204,7 @@ function commerce_payment_order_transaction_add_form_validate($form, &$form_stat
*/
function commerce_payment_order_transaction_add_form_submit($form, &$form_state) {
// If the "Add payment" button was clicked...
if ($form_state['values']['op'] == t('Add payment')) {
if (end($form_state['triggering_element']['#array_parents']) == 'add_payment') {
// Store the payment method in the form state and rebuild the form.
$form_state['payment_method'] = commerce_payment_method_instance_load($form_state['values']['payment_method']);
$form_state['rebuild'] = TRUE;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment