summaryrefslogtreecommitdiffhomepage
path: root/libs/cbi/luasrc/cbi.lua
diff options
context:
space:
mode:
authorSteven Barth <steven@midlink.org>2008-11-06 21:00:16 +0000
committerSteven Barth <steven@midlink.org>2008-11-06 21:00:16 +0000
commita5cb3b04cb9bdfe10b49edcb6b1f093cdd86cdb4 (patch)
tree874eabf60dc4efdbd3395044027de544147e678a /libs/cbi/luasrc/cbi.lua
parent4869b91bc33e374b89302a35de39e458d631d2ae (diff)
Skip validation of options on second parse cycle
Diffstat (limited to 'libs/cbi/luasrc/cbi.lua')
-rw-r--r--libs/cbi/luasrc/cbi.lua8
1 files changed, 4 insertions, 4 deletions
diff --git a/libs/cbi/luasrc/cbi.lua b/libs/cbi/luasrc/cbi.lua
index b37e21349..f733560ca 100644
--- a/libs/cbi/luasrc/cbi.lua
+++ b/libs/cbi/luasrc/cbi.lua
@@ -987,7 +987,7 @@ function TypedSection.parse(self, novld)
for i, k in ipairs(self:cfgsections()) do
AbstractSection.parse_dynamic(self, k)
if self.map:submitstate() then
- Node.parse(self, k)
+ Node.parse(self, k, novld)
if not novld and not self.override_scheme and self.map.scheme then
_uvl_validate_section(self, k)
@@ -1168,13 +1168,13 @@ function AbstractValue.mandatory(self, value)
self.rmempty = not value
end
-function AbstractValue.parse(self, section)
+function AbstractValue.parse(self, section, novld)
local fvalue = self:formvalue(section)
local cvalue = self:cfgvalue(section)
if fvalue and #fvalue > 0 then -- If we have a form value, write it to UCI
fvalue = self:transform(self:validate(fvalue, section))
- if not fvalue then
+ if not fvalue and not novld then
if self.error then
self.error[section] = "invalid"
else
@@ -1196,7 +1196,7 @@ function AbstractValue.parse(self, section)
self.section.changed = true
--luci.util.append(self.map.events, self.events)
end
- elseif cvalue ~= fvalue then
+ elseif cvalue ~= fvalue and not novld then
self:write(section, fvalue or "")
if self.error then
self.error[section] = "missing"