+-- replacement of build-in Flag.parse of cbi.lua
+-- modified to mark section as changed if value changes
+-- current parse did not do this, but it is done AbstaractValue.parse()
+function flag_parse(self, section)
+ local fexists = self.map:formvalue(
+ luci.cbi.FEXIST_PREFIX .. self.config .. "." .. section .. "." .. self.option)
+
+ 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
+