$finalSort = array();
$options['sort'] = NULL;
if (!empty($sort)) {
- foreach ((array) $sort as $s) {
- if (CRM_Utils_Rule::mysqlOrderBy($s)) {
+ if (!is_array($sort)) {
+ $sort = array_map('trim', explode(',', $sort));
+ }
+ foreach ($sort as $s) {
+ if ($s == '(1)' || CRM_Utils_Rule::mysqlOrderBy($s)) {
if ($entity && $action == 'get') {
switch (trim(strtolower($s))) {
case 'id':
*
* @param array $returnArray
* Array to append custom data too - generally $result[4] where 4 is the entity id.
+ * @param $checkPermission
* @param string $entity
* E.g membership, event.
* @param int $entity_id
return array($errors);
}
+
/**
* Used by the Validate API.
+ * @param $fieldName
* @param array $fieldInfo
* @param string $entity
* @param array $params
*
+ * @throws API_Exception
* @throws Exception
*/
function _civicrm_api3_validate_switch_cases($fieldName, $fieldInfo, $entity, $params) {
$d = new $dao();
$fields = $d->fields();
- // Set html attributes for text fields
foreach ($fields as $name => &$field) {
+ // Denote as core field
+ $field['is_core_field'] = TRUE;
+ // Set html attributes for text fields
if (isset($field['html'])) {
$field['html'] += (array) $d::makeAttribute($field);
}
*
* @throws API_Exception
*/
-function _civicrm_api3_validate_integer(&$params, &$fieldName, &$fieldInfo, $entity) {
+function _civicrm_api3_validate_integer(&$params, $fieldName, &$fieldInfo, $entity) {
list($fieldValue, $op) = _civicrm_api3_field_value_check($params, $fieldName);
if (strpos($op, 'NULL') !== FALSE || strpos($op, 'EMPTY') !== FALSE) {
return;