$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);
}
}
$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);
}
}