From 1c06685dc3df16c371bb7f8de7fb6c85bfefa41c Mon Sep 17 00:00:00 2001 From: Edsel Date: Wed, 26 Jul 2017 12:34:31 +0530 Subject: [PATCH] CRM-20952 Bug fixes ---------------------------------------- * CRM-20952: Refresh membership tab on edits to membership payments https://issues.civicrm.org/jira/browse/CRM-20952 --- CRM/Contribute/Form/AdditionalPayment.php | 4 ++-- CRM/Contribute/Form/Contribution.php | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/CRM/Contribute/Form/AdditionalPayment.php b/CRM/Contribute/Form/AdditionalPayment.php index 15c4bb30d9..84fbcc5be1 100644 --- a/CRM/Contribute/Form/AdditionalPayment.php +++ b/CRM/Contribute/Form/AdditionalPayment.php @@ -380,8 +380,8 @@ class CRM_Contribute_Form_AdditionalPayment extends CRM_Contribute_Form_Abstract $contribution = CRM_Contribute_BAO_Contribution::retrieve($params, $defaults, $params); CRM_Contribute_BAO_Contribution::addPayments(array($contribution), $contributionStatusId); if ($this->_contributionId && CRM_Core_Permission::access('CiviMember')) { - $membershipPayments = civicrm_api3('MembershipPayment', 'Get', array('contribution_id' => $this->_contributionId)); - if ($membershipPayments['count'] > 1) { + $memPaymentCount = civicrm_api3('MembershipPayment', 'getCount', array('contribution_id' => $this->_contributionId)); + if ($memPaymentCount > 0) { $this->ajaxResponse['updateTabs']['#tab_member'] = CRM_Contact_BAO_Contact::getCountComponent('membership', $this->_contactID); } } diff --git a/CRM/Contribute/Form/Contribution.php b/CRM/Contribute/Form/Contribution.php index c19f663837..9f53559b77 100644 --- a/CRM/Contribute/Form/Contribution.php +++ b/CRM/Contribute/Form/Contribution.php @@ -1074,8 +1074,8 @@ class CRM_Contribute_Form_Contribution extends CRM_Contribute_Form_AbstractEditP $this->_id = $contribution->id; } if (!empty($this->_id) && CRM_Core_Permission::access('CiviMember')) { - $membershipPayments = civicrm_api3('MembershipPayment', 'Get', array('contribution_id' => $this->_id)); - if ($membershipPayments['count'] > 1) { + $memPaymentCount = civicrm_api3('MembershipPayment', 'getCount', array('contribution_id' => $this->_id)); + if ($memPaymentCount > 0) { $this->ajaxResponse['updateTabs']['#tab_member'] = CRM_Contact_BAO_Contact::getCountComponent('membership', $this->_contactID); } } -- 2.25.1