gluon-config-mode-contact-info: restore datatype definition
optional = true does not make sense without a datatype. When no datatype is set, the empty string will be a valid value, so data is never unset in the write function. Restore the minlength(1) datatype so the contact setting is deleted as intended when no value is provided.
This commit is contained in:
parent
b8fa1b2a99
commit
603912dd0d
@ -16,6 +16,7 @@ return function(form, uci)
|
|||||||
|
|
||||||
local o = s:option(Value, "contact", pkg_i18n.translate("Contact info"), pkg_i18n.translate("e.g. E-mail or phone number"))
|
local o = s:option(Value, "contact", pkg_i18n.translate("Contact info"), pkg_i18n.translate("e.g. E-mail or phone number"))
|
||||||
o.default = uci:get("gluon-node-info", owner, "contact")
|
o.default = uci:get("gluon-node-info", owner, "contact")
|
||||||
|
o.datatype = 'minlength(1)'
|
||||||
o.optional = true
|
o.optional = true
|
||||||
function o:write(data)
|
function o:write(data)
|
||||||
uci:set("gluon-node-info", owner, "contact", data)
|
uci:set("gluon-node-info", owner, "contact", data)
|
||||||
|
Loading…
Reference in New Issue
Block a user