From 517755e0637de0181b1ae6b280d24e9171e0f5b2 Mon Sep 17 00:00:00 2001 From: Tim Otten Date: Tue, 26 Apr 2016 12:24:21 -0700 Subject: [PATCH] CRM-18469, CRM-17984 - getTree - No more pass by reference --- CRM/Activity/Form/Activity.php | 2 +- CRM/Case/Form/CaseView.php | 2 +- CRM/Case/Form/CustomData.php | 2 +- CRM/Contact/Form/CustomData.php | 6 +++--- CRM/Contact/Form/Search/Custom/ActivitySearch.php | 2 +- CRM/Contact/Page/Inline/CustomData.php | 2 +- CRM/Event/Form/ParticipantView.php | 2 +- CRM/Grant/Form/GrantView.php | 2 +- 8 files changed, 10 insertions(+), 10 deletions(-) diff --git a/CRM/Activity/Form/Activity.php b/CRM/Activity/Form/Activity.php index 9e74fffb56..32dc72b26c 100644 --- a/CRM/Activity/Form/Activity.php +++ b/CRM/Activity/Form/Activity.php @@ -379,7 +379,7 @@ class CRM_Activity_Form_Activity extends CRM_Contact_Form_Task { if ($this->_action & CRM_Core_Action::VIEW) { // Get the tree of custom fields. - $this->_groupTree = &CRM_Core_BAO_CustomGroup::getTree('Activity', $this, + $this->_groupTree = CRM_Core_BAO_CustomGroup::getTree('Activity', $this, $this->_activityId, 0, $this->_activityTypeId ); } diff --git a/CRM/Case/Form/CaseView.php b/CRM/Case/Form/CaseView.php index a597724c53..886e3ef27f 100644 --- a/CRM/Case/Form/CaseView.php +++ b/CRM/Case/Form/CaseView.php @@ -161,7 +161,7 @@ class CRM_Case_Form_CaseView extends CRM_Core_Form { $entitySubType = !empty($values['case_type_id']) ? $values['case_type_id'] : NULL; $this->assign('caseTypeID', $entitySubType); - $groupTree = &CRM_Core_BAO_CustomGroup::getTree('Case', + $groupTree = CRM_Core_BAO_CustomGroup::getTree('Case', $this, $this->_caseID, NULL, diff --git a/CRM/Case/Form/CustomData.php b/CRM/Case/Form/CustomData.php index b5c633e163..81419825fc 100644 --- a/CRM/Case/Form/CustomData.php +++ b/CRM/Case/Form/CustomData.php @@ -65,7 +65,7 @@ class CRM_Case_Form_CustomData extends CRM_Core_Form { $this->_subTypeID = CRM_Utils_Request::retrieve('subType', 'Positive', $this, TRUE); $this->_contactID = CRM_Utils_Request::retrieve('cid', 'Positive', $this, TRUE); - $groupTree = &CRM_Core_BAO_CustomGroup::getTree('Case', + $groupTree = CRM_Core_BAO_CustomGroup::getTree('Case', $this, $this->_entityID, $this->_groupID, diff --git a/CRM/Contact/Form/CustomData.php b/CRM/Contact/Form/CustomData.php index b38d740313..24feb13a81 100644 --- a/CRM/Contact/Form/CustomData.php +++ b/CRM/Contact/Form/CustomData.php @@ -230,7 +230,7 @@ class CRM_Contact_Form_CustomData extends CRM_Core_Form { if ($this->_cdType || $this->_multiRecordDisplay == 'single') { if ($this->_copyValueId) { // cached tree is fetched - $groupTree = &CRM_Core_BAO_CustomGroup::getTree($this->_type, + $groupTree = CRM_Core_BAO_CustomGroup::getTree($this->_type, $this, $this->_entityId, $this->_groupID @@ -253,7 +253,7 @@ class CRM_Contact_Form_CustomData extends CRM_Core_Form { return $customDefaultValue; } - $groupTree = &CRM_Core_BAO_CustomGroup::getTree($this->_contactType, + $groupTree = CRM_Core_BAO_CustomGroup::getTree($this->_contactType, $this, $this->_tableID, $this->_groupID, @@ -262,7 +262,7 @@ class CRM_Contact_Form_CustomData extends CRM_Core_Form { if (empty($_POST['hidden_custom_group_count'])) { // custom data building in edit mode (required to handle multi-value) - $groupTree = &CRM_Core_BAO_CustomGroup::getTree($this->_contactType, $this, $this->_tableID, + $groupTree = CRM_Core_BAO_CustomGroup::getTree($this->_contactType, $this, $this->_tableID, $this->_groupID, $this->_contactSubType ); $customValueCount = CRM_Core_BAO_CustomGroup::buildCustomDataView($this, $groupTree, TRUE, $this->_groupID, NULL, NULL, $this->_tableID); diff --git a/CRM/Contact/Form/Search/Custom/ActivitySearch.php b/CRM/Contact/Form/Search/Custom/ActivitySearch.php index 6b4da6304d..d7b8ba87fc 100644 --- a/CRM/Contact/Form/Search/Custom/ActivitySearch.php +++ b/CRM/Contact/Form/Search/Custom/ActivitySearch.php @@ -70,7 +70,7 @@ class CRM_Contact_Form_Search_Custom_ActivitySearch extends CRM_Contact_Form_Sea ); //Add custom fields to columns array for inclusion in export - $groupTree = &CRM_Core_BAO_CustomGroup::getTree('Activity', $form, NULL, + $groupTree = CRM_Core_BAO_CustomGroup::getTree('Activity', $form, NULL, NULL, '', NULL ); diff --git a/CRM/Contact/Page/Inline/CustomData.php b/CRM/Contact/Page/Inline/CustomData.php index f3098df758..5d8d31bd47 100644 --- a/CRM/Contact/Page/Inline/CustomData.php +++ b/CRM/Contact/Page/Inline/CustomData.php @@ -51,7 +51,7 @@ class CRM_Contact_Page_Inline_CustomData extends CRM_Core_Page { //custom groups Inline $entityType = CRM_Contact_BAO_Contact::getContactType($contactId); $entitySubType = CRM_Contact_BAO_Contact::getContactSubType($contactId); - $groupTree = &CRM_Core_BAO_CustomGroup::getTree($entityType, $this, $contactId, + $groupTree = CRM_Core_BAO_CustomGroup::getTree($entityType, $this, $contactId, $cgId, $entitySubType ); $details = CRM_Core_BAO_CustomGroup::buildCustomDataView($this, $groupTree, FALSE, NULL, NULL, NULL, $contactId); diff --git a/CRM/Event/Form/ParticipantView.php b/CRM/Event/Form/ParticipantView.php index 34ead01720..ee52b4b3c7 100644 --- a/CRM/Event/Form/ParticipantView.php +++ b/CRM/Event/Form/ParticipantView.php @@ -140,7 +140,7 @@ class CRM_Event_Form_ParticipantView extends CRM_Core_Form { foreach ($allRoleIDs as $k => $v) { $roleGroupTree = CRM_Core_BAO_CustomGroup::getTree('Participant', $this, $participantID, NULL, $v, $roleCustomDataTypeID); - $eventGroupTree = &CRM_Core_BAO_CustomGroup::getTree('Participant', $this, $participantID, NULL, + $eventGroupTree = CRM_Core_BAO_CustomGroup::getTree('Participant', $this, $participantID, NULL, $values[$participantID]['event_id'], $eventNameCustomDataTypeID ); $eventTypeID = CRM_Core_DAO::getFieldValue("CRM_Event_DAO_Event", $values[$participantID]['event_id'], 'event_type_id', 'id'); diff --git a/CRM/Grant/Form/GrantView.php b/CRM/Grant/Form/GrantView.php index fecced4a2a..ba7cb835f2 100644 --- a/CRM/Grant/Form/GrantView.php +++ b/CRM/Grant/Form/GrantView.php @@ -117,7 +117,7 @@ class CRM_Grant_Form_GrantView extends CRM_Core_Form { $this->assign('attachment', $attachment); $grantType = CRM_Core_DAO::getFieldValue("CRM_Grant_DAO_Grant", $this->_id, "grant_type_id"); - $groupTree = &CRM_Core_BAO_CustomGroup::getTree("Grant", $this, $this->_id, 0, $grantType); + $groupTree = CRM_Core_BAO_CustomGroup::getTree("Grant", $this, $this->_id, 0, $grantType); CRM_Core_BAO_CustomGroup::buildCustomDataView($this, $groupTree, FALSE, NULL, NULL, NULL, $this->_id); $this->assign('id', $this->_id); -- 2.25.1