From 03f55bf651294852c131323a36c48ee2d0d18286 Mon Sep 17 00:00:00 2001 From: Coleman Watts Date: Mon, 11 Jan 2016 21:12:10 -0500 Subject: [PATCH] CRM-17795 - Apparently not every DAO has a BAO --- Civi/API/SelectQuery.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Civi/API/SelectQuery.php b/Civi/API/SelectQuery.php index 2a5d115a84..9c9d837304 100644 --- a/Civi/API/SelectQuery.php +++ b/Civi/API/SelectQuery.php @@ -516,19 +516,19 @@ class SelectQuery { * Get acl clause for an entity * * @param string $tableAlias - * @param \CRM_Core_DAO $bao + * @param \CRM_Core_DAO $daoName * @return null|string */ - private function getAclClause($tableAlias, $bao = NULL) { + private function getAclClause($tableAlias, $daoName = NULL) { if (!$this->checkPermissions) { return NULL; } - if (!$bao) { + if (!$daoName) { $bao = $this->bao; } else { - $baoName = str_replace('_DAO_', '_BAO_', $bao); - $bao = new $baoName(); + $baoName = str_replace('_DAO_', '_BAO_', $daoName); + $bao = class_exists($baoName) ? new $baoName() : new $daoName(); } return $bao->apiWhereClause($tableAlias); } -- 2.25.1