Skip to content

Commit

Permalink
luci-base: uci: fixed reorder bug where missed deletes caused off-by-one
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 9a6dc74 commit 7b2d7ba
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions modules/luci-base/htdocs/luci-static/resources/uci.js
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,7 @@ return baseclass.extend(/** @lends LuCI.uci.prototype */ {
reorderSections: function() {
var v = this.state.values,
n = this.state.creates,
d = this.state.deletes,
r = this.state.reorder,
tasks = [];

Expand All @@ -166,10 +167,16 @@ return baseclass.extend(/** @lends LuCI.uci.prototype */ {
for (var c in r) {
var o = [ ];

// skip deletes within re-orders
if (d[c])
continue;

// push creates
if (n[c])
for (var s in n[c])
o.push(n[c][s]);

// push values
for (var s in v[c])
o.push(v[c][s]);

Expand Down

0 comments on commit 7b2d7ba

Please sign in to comment.