From: Coleman Watts Date: Sun, 15 Mar 2015 23:44:08 +0000 (-0400) Subject: CRM-13072 - Fix typo in api getfields sequential X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=fce45a2f687bd7b1750d3afa1dce1aba5753b5d4;p=civicrm-core.git CRM-13072 - Fix typo in api getfields sequential --- diff --git a/api/v3/Generic.php b/api/v3/Generic.php index 1e82908eb6..400c4d7ea3 100644 --- a/api/v3/Generic.php +++ b/api/v3/Generic.php @@ -75,7 +75,7 @@ function civicrm_api3_generic_getfields($apiRequest) { $lowercase_entity = _civicrm_api_get_entity_name_from_camel($entity); $subentity = CRM_Utils_Array::value('contact_type', $apiRequest['params']); $action = CRM_Utils_Array::value('action', $apiRequest['params']); - $sequential = empty($apiRequest['params']) ? 0 : 1; + $sequential = empty($apiRequest['params']['sequential']) ? 0 : 1; $apiRequest['params']['options'] = CRM_Utils_Array::value('options', $apiRequest['params'], array()); $optionsToResolve = (array) CRM_Utils_Array::value('get_options', $apiRequest['params']['options'], array()); @@ -192,8 +192,9 @@ function civicrm_api3_generic_getfields($apiRequest) { $metadata[$fieldname]['name'] = $fieldname; } _civicrm_api3_generic_get_metadata_options($metadata, $apiRequest, $fieldname, $fieldSpec, $optionsToResolve); + // Convert options to "sequential" format - if (!empty($apiRequest['params']['sequential']) && !empty($metadata[$fieldname]['options'])) { + if ($sequential && !empty($metadata[$fieldname]['options'])) { $metadata[$fieldname]['options'] = CRM_Utils_Array::makeNonAssociative($metadata[$fieldname]['options']); } }