From e3d9e6acceb3602c95357933063592fe56abe701 Mon Sep 17 00:00:00 2001 From: Coleman Watts Date: Tue, 26 May 2020 09:26:26 -0400 Subject: [PATCH] APIv4 - skip acl clause for 1-1 custom fields --- Civi/Api4/Service/Schema/Joiner.php | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/Civi/Api4/Service/Schema/Joiner.php b/Civi/Api4/Service/Schema/Joiner.php index 6b66c57f98..4bd59de171 100644 --- a/Civi/Api4/Service/Schema/Joiner.php +++ b/Civi/Api4/Service/Schema/Joiner.php @@ -61,10 +61,11 @@ class Joiner { $target = $link->getTargetTable(); $alias = $link->getAlias(); $bao = \CRM_Core_DAO_AllCoreTables::getBAOClassName(\CRM_Core_DAO_AllCoreTables::getClassForTable($target)); - $conditions = array_merge( - $link->getConditionsForJoin($baseTable), - $query->getAclClause($alias, $bao, explode('.', $joinPath)) - ); + $conditions = $link->getConditionsForJoin($baseTable); + // Custom fields do not have a bao, and currently do not have field-specific ACLs + if ($bao) { + $conditions = array_merge($conditions, $query->getAclClause($alias, $bao, explode('.', $joinPath))); + } $query->join($side, $target, $alias, $conditions); -- 2.25.1