cbi.lua: Fix Flag.parse() to set "self.section.changed" 431/head
authorChristian Schoenebeck <christian.schoenebeck@gmail.com>
Sun, 2 Aug 2015 05:06:42 +0000 (07:06 +0200)
committerChristian Schoenebeck <christian.schoenebeck@gmail.com>
Sun, 2 Aug 2015 05:06:42 +0000 (07:06 +0200)
Add to set "self.section.changed" on changes like other values do.

Signed-off-by: Christian Schoenebeck <christian.schoenebeck@gmail.com>
modules/luci-base/luasrc/cbi.lua

index 45c91890a9256a9cca4ab8a41eaa58737da73e78..f3d4618b654879c12d7962fa13b7cb5ccb8cbec9 100644 (file)
@@ -1533,13 +1533,16 @@ function Flag.parse(self, section)
 
        if fexists then
                local fvalue = self:formvalue(section) and self.enabled or self.disabled
+               local cvalue = self:cfgvalue(section)
                if fvalue ~= self.default or (not self.optional and not self.rmempty) then
                        self:write(section, fvalue)
                else
                        self:remove(section)
                end
+               if (fvalue ~= cvalue) then self.section.changed = true end
        else
                self:remove(section)
+               self.section.changed = true
        end
 end