Skip to content

Commit

Permalink
Merge pull request civicrm#26892 from artfulrobot/artfulrobot-fix-get…
Browse files Browse the repository at this point in the history
…count-on-smartgroups

getEntitySpecificJoins sometimes returns NULL, triggering deprecation warning for trim() in php 8.1
  • Loading branch information
demeritcowboy authored Jul 21, 2023
2 parents 77d7f7b + c0ca194 commit ef7ce49
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions CRM/Contact/BAO/Query.php
Original file line number Diff line number Diff line change
Expand Up @@ -2665,7 +2665,7 @@ public static function fromClause(&$tables, $inner = NULL, $right = NULL, $prima
* @param string $primaryLocation
* @return string
*/
protected static function getEntitySpecificJoins($name, $mode, $side, $primaryLocation) {
protected static function getEntitySpecificJoins($name, $mode, $side, $primaryLocation): string {
$limitToPrimaryClause = $primaryLocation ? "AND {$name}.is_primary = 1" : '';
switch ($name) {
case 'civicrm_address':
Expand Down Expand Up @@ -2727,7 +2727,7 @@ protected static function getEntitySpecificJoins($name, $mode, $side, $primaryLo
case 'civicrm_activity_contact':
case 'source_contact':
case 'activity_priority':
return CRM_Activity_BAO_Query::from($name, $mode, $side);
return CRM_Activity_BAO_Query::from($name, $mode, $side) ?? '';

case 'civicrm_entity_tag':
$from = " $side JOIN civicrm_entity_tag ON ( civicrm_entity_tag.entity_table = 'civicrm_contact'";
Expand Down

0 comments on commit ef7ce49

Please sign in to comment.