$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])
}
// we only take "return=" as valid options
- if (CRM_Utils_Array::value('return', $apiRequest['params'])) {
+ if (!empty($apiRequest['params']['return'])) {
if (!isset($result['values'][0][$apiRequest['params']['return']])) {
return civicrm_api3_create_error("field " . $apiRequest['params']['return'] . " unset or not existing", array('invalid_field' => $apiRequest['params']['return']));
}
$output[] = array('key' => $key, 'value' => $val);
}
}
- return civicrm_api3_create_success($output);
+ return civicrm_api3_create_success($output, $apiRequest['params'], $apiRequest['entity'], 'getoptions');
}
/**