getEntitySpecificJoins sometimes returns NULL, triggering deprecation warning for...
authorRich Lott / Artful Robot <code.commits@artfulrobot.uk>
Fri, 21 Jul 2023 12:18:26 +0000 (13:18 +0100)
committerRich Lott / Artful Robot <code.commits@artfulrobot.uk>
Fri, 21 Jul 2023 12:18:26 +0000 (13:18 +0100)
commitc0ca1949b3c74945ca79a1edf7e7478aa951df91
tree3b030ea5abd3c82e272715af7f4f7147ad3ef048
parentfb38a5e47668c24bd2528a71d3d81d4970d20545
getEntitySpecificJoins sometimes returns NULL, triggering deprecation warning for trim() in php 8.1

Discovered this in the wild where an api3 Contact.getcount call for a particular smartgroup
was causing this. The smartgroup otherwise works fine.

Looking at the code, it's clear that getEntitySpecificJoins is supposed to return a string,
but in the case of civicrm_activity_contact it was returning from another function which may
return NULL. I have coalesced NULL to empty string.
CRM/Contact/BAO/Query.php