Skip to content
Snippets Groups Projects
Unverified Commit 59b21b1d authored by DaveD's avatar DaveD Committed by GitHub
Browse files

Merge pull request #22938 from colemanw/backportFixQueryHook

Fix backward-compatability for new method in CRM_Contact_BAO_Query_Hook
parents ca665f46 c787334b
Branches
Tags
No related merge requests found
......@@ -150,14 +150,22 @@ class CRM_Contact_BAO_Query_Hook {
}
/**
* This gives the opportunity for a single hook to return default fields.
*
* It only runs if no core components have defaults for this $mode.
* The expectation is that only one hook will handle this mode, so just
* the first one to return a value is used.
*
* @param $mode
* @return array|null
*/
public function getDefaultReturnProperties($mode) {
foreach (self::getSearchQueryObjects() as $obj) {
$properties = $obj::defaultReturnProperties($mode);
if ($properties) {
return $properties;
foreach ($this->getSearchQueryObjects() as $obj) {
if (method_exists($obj, 'defaultReturnProperties')) {
$properties = $obj::defaultReturnProperties($mode);
if ($properties) {
return $properties;
}
}
}
return NULL;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment