* libs/cbi: Fixed a bug which prevented creation of non-anonymous sections
[project/luci.git] / libs / cbi / luasrc / cbi.lua
index d6a5cca..2e788be 100644 (file)
@@ -173,7 +173,11 @@ end
 
 -- UCI set
 function Map.set(self, section, option, value)
-       return uci.set(self.config, section, option or value, option and value)
+       if option then
+               return uci.set(self.config, section, option, value)
+       else
+               return uci.set(self.config, section, value)
+       end
 end
 
 -- UCI del
@@ -579,9 +583,6 @@ end
 --[[
 Value - A one-line value
        maxlength:      The maximum length
-       isnumber:       The value must be a valid (floating point) number
-       isinteger:  The value must be a valid integer
-       ispositive: The value must be positive (and a number)
 ]]--
 Value = class(AbstractValue)
 
@@ -590,8 +591,6 @@ function Value.__init__(self, ...)
        self.template  = "cbi/value"
 
        self.maxlength  = nil
-       self.isnumber   = false
-       self.isinteger  = false
 end
 
 -- This validation is a bit more complex
@@ -600,7 +599,7 @@ function Value.validate(self, val)
                val = nil
        end
 
-       return luci.util.validate(val, self.isnumber, self.isinteger)
+       return val
 end