From 33933a494b56291090a65c97fb1b8657acc922ef Mon Sep 17 00:00:00 2001 From: eileen Date: Mon, 24 Aug 2020 13:11:07 +1200 Subject: [PATCH] Do not pass by reference for createRelatedMemberships There are 2 parameters passed by reference to this function 1) dao - this is not altered 2) params - this IS altered but the calling function (create) does not use it again. While it's possible a function that calls create uses it again the idea that they would want the params to have been altered to refer to a different related relationship does not seem probable. Tests on this are in JobTest & apiv3_MembershipTest --- CRM/Member/BAO/Membership.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CRM/Member/BAO/Membership.php b/CRM/Member/BAO/Membership.php index 4f2f491ec6..1030eaae1c 100644 --- a/CRM/Member/BAO/Membership.php +++ b/CRM/Member/BAO/Membership.php @@ -1324,7 +1324,7 @@ WHERE civicrm_membership.contact_id = civicrm_contact.id * @throws \CRM_Core_Exception * @throws \CiviCRM_API3_Exception */ - public static function createRelatedMemberships(&$params, &$dao, $reset = FALSE) { + public static function createRelatedMemberships($params, $dao, $reset = FALSE) { // CRM-4213 check for loops, using static variable to record contacts already processed. if (!isset(\Civi::$statics[__CLASS__]['related_contacts'])) { \Civi::$statics[__CLASS__]['related_contacts'] = []; -- 2.25.1