From c7996ae42e4795eae2a0c2827949a2350f7108a9 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 afedccb0ce..d52b0c728c 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();