projects
/
project
/
luci.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
73aca68
)
luci-lua-runtime: dispatcher.lua: translate legacy node "target" property
author
Jo-Philipp Wich
<jo@mein.io>
Thu, 10 Nov 2022 21:33:38 +0000
(22:33 +0100)
committer
Jo-Philipp Wich
<jo@mein.io>
Thu, 10 Nov 2022 21:33:38 +0000
(22:33 +0100)
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>
modules/luci-lua-runtime/luasrc/dispatcher.lua
patch
|
blob
|
history
diff --git
a/modules/luci-lua-runtime/luasrc/dispatcher.lua
b/modules/luci-lua-runtime/luasrc/dispatcher.lua
index cd850aa3657ca2c4da996fe84ed51185741e5b0d..5c349114c456637be501e7b9a3e7b7aef82b60bb 100644
(file)
--- 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