I have encountered a condition when processing an order for an anonymous user following payment using the pxpay module, and there are no payment records available. In this case, the "foreach" loop on line 77 in function "uc_dps_pxpay_complete" generates a warning message.
The warning message can be avoided by enclosing the foreach loop in a test for returned payment records as the function "uc_payment_load_payments" will return FALSE if none are available. See below:
if ($payments = uc_payment_load_payments($order_id)) {
foreach ($payments as $payment) {
if ($payment->comment == $comment) {
$duplicate_flag = TRUE;
}
}
}
Comments
Comment #1
jayelless commentedPatch attached.
Comment #2
xurizaemonThanks for the patch. Duplicate of #882050: After successful payment, get: Invalid argument supplied for foreach() in uc_paymentexpress/uc_dps_pxpay.pages.inc on line 78., similar fix applied there.