From: Coleman Watts Date: Thu, 11 Apr 2013 04:28:10 +0000 (-0700) Subject: Fix failure to recognize CamelCase entity names CRM-11817 X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=47e6af81851f91fe6f722fb8ae214dc7227037e5;p=civicrm-core.git Fix failure to recognize CamelCase entity names CRM-11817 --- diff --git a/CRM/Core/DAO/permissions.php b/CRM/Core/DAO/permissions.php index 3b246e6d21..53b1205733 100644 --- a/CRM/Core/DAO/permissions.php +++ b/CRM/Core/DAO/permissions.php @@ -37,7 +37,7 @@ * @return array of permissions to check for this entity-action combo */ function _civicrm_api3_permissions($entity, $action, &$params) { - $entity = strtolower($entity); + $entity = _civicrm_api_get_entity_name_from_camel($entity); $action = strtolower($action); /** diff --git a/api/api.php b/api/api.php index b18318b967..0998b5c157 100644 --- a/api/api.php +++ b/api/api.php @@ -517,6 +517,8 @@ function _civicrm_api_replace_variables($entity, $action, &$params, &$parentResu * * @param string $entity entity name in various formats e.g. Contribution, contribution, OptionValue, option_value, UFJoin, uf_join * @return string $entity entity name in underscore separated format + * + * FIXME: Why isn't this called first thing in civicrm_api wrapper? */ function _civicrm_api_get_entity_name_from_camel($entity) { if ($entity == strtolower($entity)) {