From 18b623d0f95eeb5898bc6d7efae5eaa61912fba4 Mon Sep 17 00:00:00 2001 From: Coleman Watts Date: Fri, 3 Jun 2016 15:28:37 -0600 Subject: [PATCH] Fix undeclared variables in custom activity search --- CRM/Contact/Form/Search/Custom/ActivitySearch.php | 9 +++------ CRM/Core/BAO/CustomGroup.php | 2 +- 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/CRM/Contact/Form/Search/Custom/ActivitySearch.php b/CRM/Contact/Form/Search/Custom/ActivitySearch.php index d7b8ba87fc..ff5bd53846 100644 --- a/CRM/Contact/Form/Search/Custom/ActivitySearch.php +++ b/CRM/Contact/Form/Search/Custom/ActivitySearch.php @@ -70,12 +70,10 @@ 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, - NULL, '', NULL - ); + $groupTree = CRM_Core_BAO_CustomGroup::getTree('Activity'); //use simplified formatted groupTree - $groupTree = CRM_Core_BAO_CustomGroup::formatGroupTree($groupTree, 1, $form); + $groupTree = CRM_Core_BAO_CustomGroup::formatGroupTree($groupTree); //cycle through custom fields and assign to _columns array foreach ($groupTree as $key) { @@ -84,7 +82,6 @@ class CRM_Contact_Form_Search_Custom_ActivitySearch extends CRM_Contact_Form_Sea $this->_columns[$fieldlabel] = $field['column_name']; } } - //end custom fields } /** @@ -204,7 +201,7 @@ class CRM_Contact_Form_Search_Custom_ActivitySearch extends CRM_Contact_Form_Sea } // add custom group fields to SELECT and FROM clause - $groupTree = CRM_Core_BAO_CustomGroup::getTree('Activity', $form, NULL, NULL, '', NULL); + $groupTree = CRM_Core_BAO_CustomGroup::getTree('Activity', $this); foreach ($groupTree as $key) { if (!empty($key['extends']) && $key['extends'] == 'Activity') { diff --git a/CRM/Core/BAO/CustomGroup.php b/CRM/Core/BAO/CustomGroup.php index 0a9b3e78bc..1c21f8f893 100644 --- a/CRM/Core/BAO/CustomGroup.php +++ b/CRM/Core/BAO/CustomGroup.php @@ -1821,7 +1821,7 @@ SELECT IF( EXISTS(SELECT name FROM civicrm_contact_type WHERE name like %1), 1, * * @return array */ - public static function formatGroupTree(&$groupTree, $groupCount = 1, &$form) { + public static function formatGroupTree(&$groupTree, $groupCount = 1, &$form = NULL) { $formattedGroupTree = array(); $uploadNames = array(); -- 2.25.1