From 603912dd0d8bed3af2e2e155f1a37fa50b0b1193 Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Mon, 4 Jun 2018 23:37:32 +0200 Subject: [PATCH] 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. --- .../luasrc/lib/gluon/config-mode/wizard/0500-contact-info.lua | 1 + 1 file changed, 1 insertion(+) diff --git a/package/gluon-config-mode-contact-info/luasrc/lib/gluon/config-mode/wizard/0500-contact-info.lua b/package/gluon-config-mode-contact-info/luasrc/lib/gluon/config-mode/wizard/0500-contact-info.lua index 3b44773e..93410734 100644 --- a/package/gluon-config-mode-contact-info/luasrc/lib/gluon/config-mode/wizard/0500-contact-info.lua +++ b/package/gluon-config-mode-contact-info/luasrc/lib/gluon/config-mode/wizard/0500-contact-info.lua @@ -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")) o.default = uci:get("gluon-node-info", owner, "contact") + o.datatype = 'minlength(1)' o.optional = true function o:write(data) uci:set("gluon-node-info", owner, "contact", data)