summaryrefslogtreecommitdiffhomepage
path: root/libs/web/luasrc/cbi.lua
diff options
context:
space:
mode:
authorJo-Philipp Wich <jow@openwrt.org>2011-10-09 20:07:02 +0000
committerJo-Philipp Wich <jow@openwrt.org>2011-10-09 20:07:02 +0000
commit4fb5f1aca642eb94442d37d02eb81185f1f1ef03 (patch)
treece300af056a518712b506b27cebda5325bb11a5e /libs/web/luasrc/cbi.lua
parentb666015dc2d8394854be0259cd80f05994f66dd2 (diff)
libs/web: pass origin section id to :create() callback, needed when multiple, filtered TypedSection instances of the same type are used within a single Map
Diffstat (limited to 'libs/web/luasrc/cbi.lua')
-rw-r--r--libs/web/luasrc/cbi.lua6
1 files changed, 3 insertions, 3 deletions
diff --git a/libs/web/luasrc/cbi.lua b/libs/web/luasrc/cbi.lua
index 5aa2f5a092..86658d7020 100644
--- a/libs/web/luasrc/cbi.lua
+++ b/libs/web/luasrc/cbi.lua
@@ -1095,10 +1095,10 @@ function TypedSection.parse(self, novld)
-- Create
local created
local crval = CREATE_PREFIX .. self.config .. "." .. self.sectiontype
- local name = self.map:formvalue(crval)
+ local origin, name = next(self.map:formvaluetable(crval))
if self.anonymous then
if name then
- created = self:create()
+ created = self:create(nil, origin)
end
else
if name then
@@ -1114,7 +1114,7 @@ function TypedSection.parse(self, novld)
end
if name and #name > 0 then
- created = self:create(name) and name
+ created = self:create(name, origin) and name
if not created then
self.invalid_cts = true
end