libs/web: implement forcewrite attribute for cbi options
authorJo-Philipp Wich <jow@openwrt.org>
Sat, 30 Oct 2010 02:30:09 +0000 (02:30 +0000)
committerJo-Philipp Wich <jow@openwrt.org>
Sat, 30 Oct 2010 02:30:09 +0000 (02:30 +0000)
libs/web/luasrc/cbi.lua

index 17ca18c9411493d1ff65e35eba715029162bdf50..403935aec14892a9ad2f5b2037679adc2434eb9e 100644 (file)
@@ -1281,7 +1281,7 @@ function AbstractValue.parse(self, section, novld)
                        self:add_error(section, "invalid", val_err)
                end
 
-               if fvalue and not (fvalue == cvalue) then
+               if fvalue and (self.forcewrite or not (fvalue == cvalue)) then
                        if self:write(section, fvalue) then
                                -- Push events
                                self.section.changed = true