luci-base: mvalue.htm: fix reading back multi value options
authorJo-Philipp Wich <jo@mein.io>
Sun, 7 Jul 2019 19:26:24 +0000 (21:26 +0200)
committerJo-Philipp Wich <jo@mein.io>
Sun, 7 Jul 2019 19:27:00 +0000 (21:27 +0200)
Fixes: 2a229e50c ("luci-base: fix cbi mvalue templates")
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
modules/luci-base/luasrc/view/cbi/mvalue.htm

index d1fb8036783a5f41ce06785676ff4fde5a554d5d..97e40abfa20051a98ace0d0fb3673d07d1654822 100644 (file)
@@ -1,6 +1,14 @@
 <%+cbi/valueheader%>
+<%
+       local util = require "luci.util"
+       local values = {}
+       local value
+       for value in util.imatch(self:cfgvalue(section) or self.default) do
+               values[#values+1] = value
+       end
+%>
 <div<%=attr("data-ui-widget", luci.util.serialize_json({
-       "Select", self:cfgvalue(section) or self.default, self:choices(), {
+       "Select", values, self:choices(), {
                id = cbid,
                name = cbid,
                size = self.size,