From a6c5aae987b22c9808123d0a18e3ac3cc4b9d183 Mon Sep 17 00:00:00 2001 From: kurund Date: Wed, 14 Aug 2013 02:46:50 +0530 Subject: [PATCH] fixes for CRM-13220 ---------------------------------------- * CRM-13220: Events listing ( html ) is broken http://issues.civicrm.org/jira/browse/CRM-13220 --- CRM/ACL/BAO/ACL.php | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/CRM/ACL/BAO/ACL.php b/CRM/ACL/BAO/ACL.php index b2b197a784..a4cc176796 100644 --- a/CRM/ACL/BAO/ACL.php +++ b/CRM/ACL/BAO/ACL.php @@ -822,15 +822,6 @@ SELECT g.* $acls = CRM_ACL_BAO_Cache::build($contactID); - if (!empty($includedGroups) && - is_array($includedGroups) - ) { - $ids = $includedGroups; - } - else { - $ids = array(); - } - if (!empty($acls)) { $aclKeys = array_keys($acls); $aclKeys = implode(',', $aclKeys); @@ -851,7 +842,9 @@ ORDER BY a.object_id "; $params = array(1 => array($tableName, 'String')); $dao = CRM_Core_DAO::executeQuery($query, $params); + $aclFound = FALSE; while ($dao->fetch()) { + $aclFound = TRUE; if ($dao->object_id) { if (self::matchType($type, $dao->operation)) { $ids[] = $dao->object_id; @@ -868,6 +861,18 @@ ORDER BY a.object_id break; } } + + if (!$aclFound) { + if (!empty($includedGroups) && + is_array($includedGroups) + ) { + $ids = $includedGroups; + } + else { + $ids = array(); + } + } + $cache->set($cacheKey, $ids); } } -- 2.25.1