Fix failure to recognize CamelCase entity names CRM-11817
authorColeman Watts <coleman@civicrm.org>
Thu, 11 Apr 2013 04:28:10 +0000 (21:28 -0700)
committerColeman Watts <coleman@civicrm.org>
Thu, 11 Apr 2013 16:36:54 +0000 (09:36 -0700)
CRM/Core/DAO/permissions.php
api/api.php

index 3b246e6d21411cb53974521b87787a25746bd619..53b1205733de395612da3b703ea5e9aa2df15fc0 100644 (file)
@@ -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);
 
   /**
index b18318b96708d3e35b85564eab0307c32975dce7..0998b5c157720117e1f6d31b8a6777b8917564f3 100644 (file)
@@ -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)) {