From 61239741d8a6cb9888fb379ac3e00fdb6adcc3c8 Mon Sep 17 00:00:00 2001 From: Jo-Philipp Wich Date: Sat, 23 Jan 2016 17:34:37 +0100 Subject: [PATCH] luci-base: fix initialization of MultiValue options Signed-off-by: Jo-Philipp Wich --- modules/luci-base/luasrc/cbi.lua | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/modules/luci-base/luasrc/cbi.lua b/modules/luci-base/luasrc/cbi.lua index 4dc1f2aba..218439503 100644 --- a/modules/luci-base/luasrc/cbi.lua +++ b/modules/luci-base/luasrc/cbi.lua @@ -1623,16 +1623,16 @@ function ListValue.__init__(self, ...) AbstractValue.__init__(self, ...) self.template = "cbi/lvalue" - self.keylist = {} - self.vallist = {} - self.deplist = {} self.size = 1 self.widget = "select" + + self:reset_values() end function ListValue.reset_values(self) self.keylist = {} self.vallist = {} + self.deplist = {} end function ListValue.value(self, key, val, ...) @@ -1667,11 +1667,10 @@ function MultiValue.__init__(self, ...) AbstractValue.__init__(self, ...) self.template = "cbi/mvalue" - self.keylist = {} - self.vallist = {} - self.widget = "checkbox" self.delimiter = " " + + self:reset_values() end function MultiValue.render(self, ...) @@ -1685,6 +1684,7 @@ end function MultiValue.reset_values(self) self.keylist = {} self.vallist = {} + self.deplist = {} end function MultiValue.value(self, key, val) @@ -1759,8 +1759,7 @@ function DynamicList.__init__(self, ...) AbstractValue.__init__(self, ...) self.template = "cbi/dynlist" self.cast = "table" - self.keylist = {} - self.vallist = {} + self:reset_values() end function DynamicList.reset_values(self) -- 2.25.1