From: eileenmcnaugton Date: Tue, 16 Feb 2016 08:29:26 +0000 (+1300) Subject: CRM-17751 add extra check to prevent error X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=48714ae73fac10d8a5463ab616741c6e118ba363;p=civicrm-core.git CRM-17751 add extra check to prevent error It turns out the refund_trxn_id can be set erroneously - this might be a form issue - but we also want to avoid an error here --- diff --git a/CRM/Contribute/BAO/Contribution.php b/CRM/Contribute/BAO/Contribution.php index 8cd3e5d15c..5e630c3e09 100644 --- a/CRM/Contribute/BAO/Contribution.php +++ b/CRM/Contribute/BAO/Contribution.php @@ -3285,7 +3285,7 @@ INNER JOIN civicrm_activity ON civicrm_activity_contact.activity_id = civicrm_ac // CRM-17751. if (isset($params['refund_trxn_id'])) { $refundIDs = CRM_Core_BAO_FinancialTrxn::getRefundTransactionIDs($params['id']); - if ($refundIDs['trxn_id'] != $params['refund_trxn_id']) { + if (!empty($refundIDs['financialTrxnId']) && $refundIDs['trxn_id'] != $params['refund_trxn_id']) { civicrm_api3('FinancialTrxn', 'create', array('id' => $refundIDs['financialTrxnId'], 'trxn_id' => $params['refund_trxn_id'])); } }