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 <jo@mein.io>
This commit is contained in:
Jo-Philipp Wich 2018-04-07 14:09:18 +02:00
parent 646545da56
commit 8c636c87ee

View file

@ -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