Skip to content

Commit

Permalink
dev/core#2079 [REF] clean up call to apiQuery
Browse files Browse the repository at this point in the history
This fixes a few things
1) fixes apiQuery to be called statically as it is a static function
2) casts results directly to detail
3) removes unnused variable
  • Loading branch information
eileenmcnaughton committed Oct 2, 2020
1 parent 63bb878 commit 109c24f
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions CRM/Contact/Form/Task/LabelCommon.php
Original file line number Diff line number Diff line change
Expand Up @@ -136,12 +136,9 @@ public static function getRows($contactIDs, $locationTypeID, $respectDoNotMail,
$numberofContacts = count($contactIDs);
//this does the same as calling civicrm_api3('contact, get, array('id' => array('IN' => $this->_contactIds)
// except it also handles multiple locations
$query = new CRM_Contact_BAO_Query($params, $returnProperties);
$details = $query->apiQuery($params, $returnProperties, NULL, NULL, 0, $numberofContacts);
[$details] = CRM_Contact_BAO_Query::apiQuery($params, $returnProperties, NULL, NULL, 0, $numberofContacts);

$messageToken = CRM_Utils_Token::getTokens($mailingFormat);
// $details[0] is an array of [ contactID => contactDetails ]
$details = $details[0];
// $details is an array of [ contactID => contactDetails ]
$tokenFields = CRM_Contact_Form_Task_LabelCommon::getTokenData($details);

foreach ($contactIDs as $value) {
Expand Down

0 comments on commit 109c24f

Please sign in to comment.