From 7aeb8ff1feadffe34e8aa08f7ca113a05a433774 Mon Sep 17 00:00:00 2001 From: Matthew Wire Date: Wed, 15 Jan 2020 14:42:38 +0000 Subject: [PATCH] Add parameter definition to membershipstatus.calc --- CRM/Member/BAO/Membership.php | 3 +-- api/v3/MembershipStatus.php | 3 +++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/CRM/Member/BAO/Membership.php b/CRM/Member/BAO/Membership.php index ff9077b49ced..8386983c6764 100644 --- a/CRM/Member/BAO/Membership.php +++ b/CRM/Member/BAO/Membership.php @@ -2259,10 +2259,9 @@ public static function updateAllMembershipStatus() { // CRM-7248: added excludeIsAdmin param to the following fn call to prevent moving to admin statuses //get the membership status as per id. - $newStatus = civicrm_api('membership_status', 'calc', + $newStatus = civicrm_api3('membership_status', 'calc', [ 'membership_id' => $dao2->membership_id, - 'version' => 3, 'ignore_admin_only' => TRUE, ], TRUE ); diff --git a/api/v3/MembershipStatus.php b/api/v3/MembershipStatus.php index 87d01b365608..97421d09d9bf 100644 --- a/api/v3/MembershipStatus.php +++ b/api/v3/MembershipStatus.php @@ -173,4 +173,7 @@ function civicrm_api3_membership_status_calc($membershipParams) { function _civicrm_api3_membership_status_calc_spec(&$params) { $params['membership_id']['api.required'] = 1; $params['membership_id']['title'] = 'Membership ID'; + $params['ignore_admin_only']['title'] = 'Ignore admin only statuses'; + $params['ignore_admin_only']['description'] = 'Ignore statuses that are for admin/manual assignment only'; + $params['ignore_admin_only']['type'] = CRM_Utils_Type::T_BOOLEAN; }