[luci] hack the cbi to allow custom error messages to be displayed on a form page
This commit is contained in:
parent
e53d1d384f
commit
f55b344ec4
|
@ -1402,15 +1402,11 @@ function AbstractValue.parse(self, section, novld)
|
||||||
if fvalue and #fvalue > 0 then -- If we have a form value, write it to UCI
|
if fvalue and #fvalue > 0 then -- If we have a form value, write it to UCI
|
||||||
fvalue = self:transform(self:validate(fvalue, section))
|
fvalue = self:transform(self:validate(fvalue, section))
|
||||||
if not fvalue and not novld then
|
if not fvalue and not novld then
|
||||||
if self.error then
|
if not self.error then
|
||||||
self.error[section] = "invalid"
|
|
||||||
else
|
|
||||||
self.error = { [section] = "invalid" }
|
self.error = { [section] = "invalid" }
|
||||||
end
|
end
|
||||||
if self.section.error then
|
if not self.section.error then
|
||||||
table.insert(self.section.error[section], "invalid")
|
self.section.error = { [section] = { "invalid" } }
|
||||||
else
|
|
||||||
self.section.error = {[section] = {"invalid"}}
|
|
||||||
end
|
end
|
||||||
self.map.save = false
|
self.map.save = false
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue