luci-base: fix luci.model.uci.get_first()
authorJo-Philipp Wich <jo@mein.io>
Sat, 7 Apr 2018 12:09:18 +0000 (14:09 +0200)
committerJo-Philipp Wich <jo@mein.io>
Sat, 7 Apr 2018 12:09:18 +0000 (14:09 +0200)
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>
modules/luci-base/luasrc/model/uci.lua

index 7e1c8f5..0e3950c 100644 (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