From 00bb741c31f995217c5a1399a124aaff8941b558 Mon Sep 17 00:00:00 2001 From: eileen Date: Mon, 4 Nov 2019 12:34:43 +1300 Subject: [PATCH] [REF] remove as a return Param of getHierContactDetails In trying to get to the bottom of BAO_CustomQuery I hit confusion about whether options should still exist. This removes it from the return values of getHierContactDetails, making for a cleaner later PR when we can check all calls to CRM_Contact_BAO_Query::apiQuery use the 'list' construct and only use one param - at which point we can pull it out of apiQuery --- CRM/Contact/BAO/Contact.php | 6 +++--- CRM/Core/BAO/UFGroup.php | 2 +- CRM/Profile/Form.php | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/CRM/Contact/BAO/Contact.php b/CRM/Contact/BAO/Contact.php index 2e5927e9cbe3..5dd25d81711b 100644 --- a/CRM/Contact/BAO/Contact.php +++ b/CRM/Contact/BAO/Contact.php @@ -1770,7 +1770,6 @@ public static function &exportableFields($contactType = 'Individual', $status = */ public static function getHierContactDetails($contactId, $fields) { $params = [['contact_id', '=', $contactId, 0, 0]]; - $options = []; $returnProperties = self::makeHierReturnProperties($fields, $contactId); @@ -1781,7 +1780,8 @@ public static function getHierContactDetails($contactId, $fields) { $returnProperties['household_name'] = 1; $returnProperties['contact_type'] = 1; $returnProperties['contact_sub_type'] = 1; - return list($query, $options) = CRM_Contact_BAO_Query::apiQuery($params, $returnProperties, $options); + list($query) = CRM_Contact_BAO_Query::apiQuery($params, $returnProperties); + return $query; } /** @@ -2116,7 +2116,7 @@ public static function formatProfileContactParams( // get the contact details (hier) if ($contactID) { - list($details, $options) = self::getHierContactDetails($contactID, $fields); + $details = self::getHierContactDetails($contactID, $fields); $contactDetails = $details[$contactID]; $data['contact_type'] = CRM_Utils_Array::value('contact_type', $contactDetails); diff --git a/CRM/Core/BAO/UFGroup.php b/CRM/Core/BAO/UFGroup.php index 08520c7fabd7..9030b200f19a 100644 --- a/CRM/Core/BAO/UFGroup.php +++ b/CRM/Core/BAO/UFGroup.php @@ -2304,7 +2304,7 @@ public static function setProfileDefaults( ) { if (!$componentId) { //get the contact details - list($contactDetails, $options) = CRM_Contact_BAO_Contact::getHierContactDetails($contactId, $fields); + $contactDetails = CRM_Contact_BAO_Contact::getHierContactDetails($contactId, $fields); $details = CRM_Utils_Array::value($contactId, $contactDetails); $multipleFields = ['website' => 'url']; diff --git a/CRM/Profile/Form.php b/CRM/Profile/Form.php index 0013777bee9d..1695d4490e3a 100644 --- a/CRM/Profile/Form.php +++ b/CRM/Profile/Form.php @@ -1119,7 +1119,7 @@ public function postProcess() { $contactDetails = CRM_Contact_BAO_Contact::getHierContactDetails($this->_id, $greetingTypes ); - $details = $contactDetails[0][$this->_id]; + $details = $contactDetails[$this->_id]; } if (!(!empty($details['addressee_id']) || !empty($details['email_greeting_id']) || CRM_Utils_Array::value('postal_greeting_id', $details)