Details
-
Type:
Bug
-
Status: Done/Fixed
-
Priority:
Major
-
Resolution: Fixed/Completed
-
Affects Version/s: 4.3.0, 4.4.0
-
Fix Version/s: 4.4.0
-
Component/s: None
-
Labels:None
Description
Some discussion here: http://forum.civicrm.org/index.php/topic,30298
OK, so the problem is that it is literally impossible to preserve order in a JSON object.
http://stackoverflow.com/questions/10034655/how-to-maintain-order-when-parsing-json-from-javascript
Other api actions accept a "sequential" param which will return a javascript array rather than an object, which will preserve ordering. So I think the solution is to support this param for getoptions.
Return signature:
[
,
{key: 2, value: 'Male'},
{key: 3, value: 'Transgender'}]