summaryrefslogtreecommitdiffhomepage
path: root/modules/luci-base
diff options
context:
space:
mode:
Diffstat (limited to 'modules/luci-base')
-rw-r--r--modules/luci-base/luasrc/cbi.lua11
1 files changed, 6 insertions, 5 deletions
diff --git a/modules/luci-base/luasrc/cbi.lua b/modules/luci-base/luasrc/cbi.lua
index 4728642118..4800d2aa72 100644
--- a/modules/luci-base/luasrc/cbi.lua
+++ b/modules/luci-base/luasrc/cbi.lua
@@ -1226,13 +1226,14 @@ function TypedSection.parse(self, novld)
local stval = RESORT_PREFIX .. self.config .. "." .. self.sectiontype
local order = self.map:formvalue(stval)
if order and #order > 0 then
- local sid
- local num = 0
+ local sids, sid = { }, nil
for sid in util.imatch(order) do
- self.map.uci:reorder(self.config, sid, num)
- num = num + 1
+ sids[#sids+1] = sid
+ end
+ if #sids > 0 then
+ self.map.uci:reorder(self.config, sids)
+ self.changed = true
end
- self.changed = (num > 0)
end
end