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 7e1c8f5952ccbc79fd1f28aa56b4c8c8cd51d64e..0e3950c0bd5158c534fe51a29b1df57d30ffa2fd 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