- if fvalue ~= self.default or (not self.optional and not self.rmempty) then
- self:write(section, fvalue)
- else
+ local val_err
+ fvalue, val_err = self:validate(fvalue, section)
+ if not fvalue then
+ if not novld then
+ self:add_error(section, "invalid", val_err)
+ end
+ return
+ end
+ if fvalue == self.default and (self.optional or self.rmempty) then