From 59a28c67210f4ea51cff62602450a23e207b7b3b Mon Sep 17 00:00:00 2001 From: Nils Schneider Date: Sun, 2 Mar 2014 19:28:40 +0100 Subject: [PATCH] gluon-config-mode: allow contact field to be empty --- .../lib/lua/luci/model/cbi/gluon-config-mode/wizard.lua | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/package/gluon-config-mode/files/usr/lib/lua/luci/model/cbi/gluon-config-mode/wizard.lua b/package/gluon-config-mode/files/usr/lib/lua/luci/model/cbi/gluon-config-mode/wizard.lua index 14a5d83a..05ef304f 100644 --- a/package/gluon-config-mode/files/usr/lib/lua/luci/model/cbi/gluon-config-mode/wizard.lua +++ b/package/gluon-config-mode/files/usr/lib/lua/luci/model/cbi/gluon-config-mode/wizard.lua @@ -78,7 +78,7 @@ einsehbar sein wird.]]) o = s:option(Value, "_contact", "Kontakt") o.default = uci:get_first("gluon-node-info", "owner", "contact", "") -o.rmempty = false +o.rmempty = true o.datatype = "string" o.description = "z.B. E-Mail oder Telefonnummer" o.maxlen = 140 @@ -122,7 +122,11 @@ function f.handle(self, state, data) uci:set("gluon-node-info", sname, "latitude", data._latitude) uci:set("gluon-node-info", sname, "longitude", data._longitude) end - uci:set("gluon-node-info", uci:get_first("gluon-node-info", "owner"), "contact", data._contact) + if data._contact ~= nil then + uci:set("gluon-node-info", uci:get_first("gluon-node-info", "owner"), "contact", data._contact) + else + uci:set("gluon-node-info", uci:get_first("gluon-node-info", "owner"), "contact") + end uci:save("gluon-node-info") uci:commit("gluon-node-info")