Skip to content

Commit

Permalink
[REF] remove as a return Param of getHierContactDetails
Browse files Browse the repository at this point in the history
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
  • Loading branch information
eileenmcnaughton committed Nov 3, 2019
1 parent c796d7a commit 00bb741
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions CRM/Contact/BAO/Contact.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand All @@ -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;
}

/**
Expand Down Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion CRM/Core/BAO/UFGroup.php
Original file line number Diff line number Diff line change
Expand Up @@ -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'];

Expand Down
2 changes: 1 addition & 1 deletion CRM/Profile/Form.php
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 00bb741

Please sign in to comment.