From 73dbaa0dfbd6a8539b421466fdbb741d28f1122e Mon Sep 17 00:00:00 2001 From: nathangray Date: Wed, 17 Aug 2016 10:52:45 -0600 Subject: [PATCH] Preserve link order set by application --- api/src/Etemplate/Widget/Link.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/api/src/Etemplate/Widget/Link.php b/api/src/Etemplate/Widget/Link.php index 693327b728..20fe3a5787 100644 --- a/api/src/Etemplate/Widget/Link.php +++ b/api/src/Etemplate/Widget/Link.php @@ -108,9 +108,11 @@ class Link extends Etemplate\Widget $links = Api\Link::query($app, $pattern, $options); + // Add ' ' to key so javascript does not parse it as a number. + // This preserves the order set by the application. $linksc = array_combine(array_map(function($k) { - return (string)$k; + return (string)" ".$k; }, array_keys($links)), $links); $response = Api\Json\Response::get();