Merge pull request #2514 from colemanw/ac2
[civicrm-core.git] / api / v3 / Generic.php
index 3c4fc8a189947e6261c6931d4ecbd2533f9520ec..920ff3f4cba9301e1f780b1e741babe7facda7c9 100644 (file)
@@ -40,13 +40,9 @@ function civicrm_api3_generic_getfields($apiRequest) {
   $action       = strtolower(CRM_Utils_Array::value('action', $apiRequest['params']));
   $sequential = empty($apiRequest['params']) ? 0 : 1;
   $apiOptions = CRM_Utils_Array::value('options', $apiRequest['params'], array());
-  if ($action == 'getvalue' || $action == 'getvalue' || $action == 'getcount') {
+  if (!$action || $action == 'getvalue' || $action == 'getcount') {
     $action = 'get';
   }
-
-  if (empty($action)) {
-    $action='get';
-  }
   // determines whether to use unique field names - seem comment block above
   $unique = TRUE;
   if (empty($apiOptions) && isset($results[$entity . $subentity]) && isset($action, $results[$entity . $subentity])
@@ -239,7 +235,7 @@ function civicrm_api3_generic_getoptions($apiRequest) {
       $output[] = array('key' => $key, 'value' => $val);
     }
   }
-  return civicrm_api3_create_success($output);
+  return civicrm_api3_create_success($output, $apiRequest['params'], $apiRequest['entity'], 'getoptions');
 }
 
 /**