Skip to content

Commit

Permalink
luci-base: form: fix sort order bug triggered by integer types
Browse files Browse the repository at this point in the history
Signed-off-by: Paul Donald <[email protected]>
  • Loading branch information
systemcrash committed Nov 25, 2024
1 parent 7b2d7ba commit fefb9ac
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion modules/luci-base/htdocs/luci-static/resources/form.js
Original file line number Diff line number Diff line change
Expand Up @@ -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));
Expand Down

0 comments on commit fefb9ac

Please sign in to comment.