From 8800fc1f32829b8d48e6d6b744c8cf2305f835ab Mon Sep 17 00:00:00 2001 From: eileen Date: Thu, 16 Apr 2020 17:33:28 +1200 Subject: [PATCH] Don't pass empty ids paramter, fix fatal --- CRM/Member/Form/MembershipView.php | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/CRM/Member/Form/MembershipView.php b/CRM/Member/Form/MembershipView.php index 85d207281f..6f4a71580e 100644 --- a/CRM/Member/Form/MembershipView.php +++ b/CRM/Member/Form/MembershipView.php @@ -92,6 +92,9 @@ class CRM_Member_Form_MembershipView extends CRM_Core_Form { * Create or delete. * @param array $owner * Primary membership info (membership_id, contact_id, membership_type ...). + * + * @throws \CRM_Core_Exception + * @throws \CiviCRM_API3_Exception */ public function relAction($action, $owner) { switch ($action) { @@ -119,16 +122,14 @@ class CRM_Member_Form_MembershipView extends CRM_Core_Form { 'skipStatusCal' => TRUE, 'createActivity' => TRUE, ]; - // @todo stop passing $ids here (we are only doing so because of passbyreference) - $ids = []; - CRM_Member_BAO_Membership::create($params, $ids); + CRM_Member_BAO_Membership::create($params); $relatedDisplayName = CRM_Contact_BAO_Contact::displayName($params['contact_id']); CRM_Core_Session::setStatus(ts('Related membership for %1 has been created.', [1 => $relatedDisplayName]), ts('Membership Added'), 'success'); break; default: - CRM_Core_Error::fatal(ts("Invalid action specified in URL")); + throw new CRM_Core_Exception(ts('Invalid action specified in URL')); } // Redirect back to membership view page for the owner, without the relAction parameters -- 2.25.1