$helper = '_' . $hypApiRequest['function'] . '_spec';
if (function_exists($helper)) {
// alter
- $helper($metadata);
+ $helper($metadata, $apiRequest);
}
$fieldsToResolve = (array) CRM_Utils_Array::value('get_options', $apiOptions, array());
if(is_numeric (CRM_Utils_Array::value('values', $result))) {
return (int) $result['values'];
}
+ if(!isset($result['count'])) {
+ throw new API_Exception(ts('Unexpected result from getcount') . print_r($result, TRUE));
+ }
return $result['count'];
}
// Validate 'context' from params
$context = CRM_Utils_Array::value('context', $apiRequest['params']);
CRM_Core_DAO::buildOptionsContext($context);
+ unset($apiRequest['params']['context'], $apiRequest['params']['field']);
$baoName = _civicrm_api3_get_BAO($apiRequest['entity']);
- $options = $baoName::buildOptions($fieldName, $context);
+ $options = $baoName::buildOptions($fieldName, $context, $apiRequest['params']);
if ($options === FALSE) {
return civicrm_api3_create_error("The field '{$fieldName}' has no associated option list.");
}