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 17ca18c..403935a 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