libs/web: implement forcewrite attribute for cbi options
[project/luci.git] / 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