X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=CRM%2FCore%2FPermission.php;h=52cc6f041a4b651017650957e751b60352cd28f5;hb=2efcf0c212127e3281834edf26b64d2bbd5e0bb5;hp=d3c318cdbca91855727e9ebbfe75b80cdb0ab6de;hpb=cd43c5e3e0d23947f0227e3bc0766a16f2bec38c;p=civicrm-core.git diff --git a/CRM/Core/Permission.php b/CRM/Core/Permission.php index d3c318cdbc..52cc6f041a 100644 --- a/CRM/Core/Permission.php +++ b/CRM/Core/Permission.php @@ -209,7 +209,7 @@ class CRM_Core_Permission { } public static function ufGroup($type = CRM_Core_Permission::VIEW) { - $ufGroups = CRM_Core_PseudoConstant::ufGroup(); + $ufGroups = CRM_Core_PseudoConstant::get('CRM_Core_DAO_UFField', 'uf_group_id'); $allGroups = array_keys($ufGroups); @@ -279,7 +279,11 @@ class CRM_Core_Permission { if (!$eventID) { return $permissionedEvents; } - return array_search($eventID, $permissionedEvents) === FALSE ? NULL : $eventID; + if (!empty($permissionedEvents)){ + return array_search($eventID, $permissionedEvents) === FALSE ? NULL : $eventID; + } else { + return $eventID; + } } static function eventClause($type = CRM_Core_Permission::VIEW, $prefix = NULL) {