From 5997245238f42e83c3cfb5757333d5d663b3b22b Mon Sep 17 00:00:00 2001 From: eileen Date: Thu, 4 Apr 2019 11:11:25 +1300 Subject: [PATCH] Add error handling for when no test procesor row exists. This is not really a valid config but for sites that have processors without test rows recent changes will make that problematic. We can be nice --- CRM/Admin/Page/PaymentProcessor.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/CRM/Admin/Page/PaymentProcessor.php b/CRM/Admin/Page/PaymentProcessor.php index e3b64b6339..b79a3d4eed 100644 --- a/CRM/Admin/Page/PaymentProcessor.php +++ b/CRM/Admin/Page/PaymentProcessor.php @@ -158,7 +158,13 @@ class CRM_Admin_Page_PaymentProcessor extends CRM_Core_Page_Basic { $dao->id ); $paymentProcessor[$dao->id]['financialAccount'] = CRM_Contribute_PseudoConstant::getRelationalFinancialAccount($dao->id, NULL, 'civicrm_payment_processor', 'financial_account_id.name'); - $paymentProcessor[$dao->id]['test_id'] = CRM_Financial_BAO_PaymentProcessor::getTestProcessorId($dao->id); + + try { + $paymentProcessor[$dao->id]['test_id'] = CRM_Financial_BAO_PaymentProcessor::getTestProcessorId($dao->id); + } + catch (CiviCRM_API3_Exception $e) { + CRM_Core_Session::setStatus(ts('No test processor entry exists for %1. Not having a test entry for each processor could cause problems', [$dao->name])); + } } $this->assign('rows', $paymentProcessor); -- 2.25.1