Posted by RaspberryBlack on February 6, 2012 at 2:53am
2 followers
Jump to:
| Project: | Ubercart MIGS Gateway |
| Version: | 7.x-2.x-dev |
| Component: | User interface |
| Category: | bug report |
| Priority: | major |
| Assigned: | Unassigned |
| Status: | active |
Issue Summary
Same like here: http://drupal.org/node/779968
The Back button on the review order page leads to the Payment Gateway instead of going back. This really needs a fix.
Comments
#1
My work around:
<?php
function mymodule_form_alter(&$form, &$form_state, $form_id) {
// Remove the regular buggy back button because it was submitting the form instead of redirecting to previous page
if ($form_id == 'uc_cart_checkout_review_form') {
unset($form['actions']['back']);
}
// Create a new back button that redirects to the previous page
if ($form_id == 'uc_migs_form') {
$form['back_submit'] = array(
'#type' => 'submit',
'#value' => t('Back'),
'#submit' => array('mymodule_form_alter_back'),
);
}
}
function mymodule_form_alter_back($form, &$form_state) {
// this url is hardcoded as $form_state['storage']['base_path'] doesnt exist for some reason
// see: line 504 @ sites/default/modules/contrib/ubercart/uc_cart.pages.inc
$form_state['redirect'] = 'cart/checkout';
}
?>