summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorPaul Donald <newtwen+github@gmail.com>2024-11-25 21:32:39 +0100
committerPaul Donald <newtwen+github@gmail.com>2024-11-25 21:32:39 +0100
commitfefb9acf57ad11012c336e4d056b074620b87d2f (patch)
treeb5796f8b325d1132b4308d84968d67833debf322
parent7b2d7ba2a5fc438db7fc99e393b0ced5321c3f6a (diff)
luci-base: form: fix sort order bug triggered by integer types
Signed-off-by: Paul Donald <newtwen+github@gmail.com>
-rw-r--r--modules/luci-base/htdocs/luci-static/resources/form.js4
1 files changed, 3 insertions, 1 deletions
diff --git a/modules/luci-base/htdocs/luci-static/resources/form.js b/modules/luci-base/htdocs/luci-static/resources/form.js
index 53ea3c5bcd..7cf2ae7597 100644
--- a/modules/luci-base/htdocs/luci-static/resources/form.js
+++ b/modules/luci-base/htdocs/luci-static/resources/form.js
@@ -3068,8 +3068,10 @@ var CBITableSection = CBITypedSection.extend(/** @lends LuCI.form.TableSection.p
n.classList.remove('flash')
});
+ val = Array.isArray(val) ? val.join(' '): val;
+ val = `${val}`; // coerce non-string types to string
list.push([
- ui.Table.prototype.deriveSortKey((val != null) ? val.trim() : ''),
+ ui.Table.prototype.deriveSortKey((val != null && typeof val.trim === 'function') ? val.trim() : ''),
tr
]);
}, this));