From: Jo-Philipp Wich Date: Sat, 7 Apr 2018 12:09:18 +0000 (+0200) Subject: luci-base: fix luci.model.uci.get_first() X-Git-Url: http://git.archive.openwrt.org/?p=project%2Fluci.git;a=commitdiff_plain;h=8c636c87ee14d4d0bac904b23f35b016b8cf19e0 luci-base: fix luci.model.uci.get_first() Properly propagate the config parameter to the foreach iterator in order to fix get_first() lookups. Fixes #1734. Signed-off-by: Jo-Philipp Wich --- diff --git a/modules/luci-base/luasrc/model/uci.lua b/modules/luci-base/luasrc/model/uci.lua index 7e1c8f595..0e3950c0b 100644 --- a/modules/luci-base/luasrc/model/uci.lua +++ b/modules/luci-base/luasrc/model/uci.lua @@ -242,7 +242,7 @@ end function get_first(self, config, stype, option, default) local rv = default - self:foreach(conf, stype, function(s) + self:foreach(config, stype, function(s) local val = not option and s[".name"] or s[option] if type(default) == "number" then