summaryrefslogtreecommitdiffhomepage
path: root/libs/cbi/luasrc/cbi.lua
diff options
context:
space:
mode:
authorJo-Philipp Wich <jow@openwrt.org>2008-09-06 22:37:56 +0000
committerJo-Philipp Wich <jow@openwrt.org>2008-09-06 22:37:56 +0000
commitc5278e17dc329be547c33a46e56fd655c77476c2 (patch)
tree99530b66e4fb1dc416b9eba77752ff4cf21d7cd7 /libs/cbi/luasrc/cbi.lua
parenta9875adb29da9f42da5e6e8839917a0b76d5c19d (diff)
* luci/libs/cbi: fix error assignment in cbi sections
Diffstat (limited to 'libs/cbi/luasrc/cbi.lua')
-rw-r--r--libs/cbi/luasrc/cbi.lua14
1 files changed, 12 insertions, 2 deletions
diff --git a/libs/cbi/luasrc/cbi.lua b/libs/cbi/luasrc/cbi.lua
index 09ba553ec2..c1eefca5dd 100644
--- a/libs/cbi/luasrc/cbi.lua
+++ b/libs/cbi/luasrc/cbi.lua
@@ -89,7 +89,11 @@ local function _uvl_validate_section(node, name)
local function tag_fields(e)
if e.option and node.fields[e.option] then
- node.fields[e.option].error = e
+ if node.fields[e.option].error then
+ node.fields[e.option].error[name] = e
+ else
+ node.fields[e.option].error = { [name] = e }
+ end
elseif e.childs then
for _, c in ipairs(e.childs) do tag_fields(c) end
end
@@ -104,7 +108,13 @@ local function _uvl_validate_section(node, name)
table.insert( s, c:string() )
end
end
- if #s > 0 then node.error = s end
+ if #s > 0 then
+ if node.error then
+ node.error[name] = s
+ else
+ node.error = { [name] = s }
+ end
+ end
end
local stat, err = node.map.validator:validate_section(node.config, name, co)