| Project: | Ubercart Contributions |
| Component: | Code |
| Category: | |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | active |
Jump to:
I just upgraded from v1.5 to v1.6 and when I go to the Payment settings page then click on the Payment gateways tab, I get the following error:
warning: Invalid argument supplied for foreach() in /home/lambspun/public_html/modules/ubercart/payment/uc_credit/uc_credit.module on line 147.
I re-uploaded the uc_credit.module file to make sure it wasn't corrupt. The lines in uc_credit.module in that area are:
foreach ($form['gateways'] as $key => $value) {
// Get the transaction types associated with this gateway.
$gateway_types = uc_credit_gateway_txn_types($key);
// Default to authorization plus capture if none are specified.
if (empty($types) && !is_null(_payment_gateway_data($key, 'credit'))) {
$types = array(UC_CREDIT_AUTH_CAPTURE);
}
// Loop through all the available transaction types.
$options = array();
$txn_types = array(
UC_CREDIT_AUTH_ONLY => t('Authorization only'),
UC_CREDIT_AUTH_CAPTURE => t('Authorize and capture immediately'),
);
foreach ($txn_types as $type => $title) {
// Add the current one to the options if the gateway supports it.
if (in_array($type, $gateway_types)) {
$options[$type] = $title;
}
}
$form['gateways'][$key]['uc_pg_'. $key .'_cc_txn_type'] = array(
'#type' => 'radios',
'#title' => t('Default credit transaction type'),
'#description' => t('Only available transaction types are listed. The default will be used unless an administrator chooses otherwise through the terminal.'),
'#options' => $options,
'#default_value' => variable_get('uc_pg_'. $key .'_cc_txn_type', UC_CREDIT_AUTH_CAPTURE),
'#weight' => -5,
);
}
TIA

