Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/openwrt/luci.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJo-Philipp Wich <jo@mein.io>2022-11-11 00:33:38 +0300
committerJo-Philipp Wich <jo@mein.io>2022-11-11 00:33:38 +0300
commit1da816ddf2b811ae98b5c05f1dbf84653071873e (patch)
tree6eb5ccfd572e4c4e14dc452dcf03fb460b98213c
parent73aca68b9e35857ec155f33ca1b1fb5358d69e52 (diff)
luci-lua-runtime: dispatcher.lua: translate legacy node "target" property
Some legacy Lua controllers declare menu entries by first invoking `node()` and then setting the `.target` property on the resulting object. Make sure to properly translate such menu nodes into the internal menu JSON representation. Fixes: #6090 Signed-off-by: Jo-Philipp Wich <jo@mein.io>
-rw-r--r--modules/luci-lua-runtime/luasrc/dispatcher.lua5
1 files changed, 5 insertions, 0 deletions
diff --git a/modules/luci-lua-runtime/luasrc/dispatcher.lua b/modules/luci-lua-runtime/luasrc/dispatcher.lua
index cd850aa365..5c349114c4 100644
--- a/modules/luci-lua-runtime/luasrc/dispatcher.lua
+++ b/modules/luci-lua-runtime/luasrc/dispatcher.lua
@@ -186,6 +186,11 @@ function process_lua_controller(path)
entry.auth = {}
end
+ if entry.action == nil and type(entry.target) == "table" then
+ entry.action = entry.target
+ entry.target = nil
+ end
+
entry.leaf = nil
entry.file_depends = nil