From 4b7fe42410a91ae3e9db26b49acca4c8385f7092 Mon Sep 17 00:00:00 2001 From: Jo-Philipp Wich Date: Fri, 10 Jan 2020 22:12:03 +0100 Subject: [PATCH] luci-base: dispatcher: remove empty firstchild nodes from menu Signed-off-by: Jo-Philipp Wich (cherry picked from commit fd7961337f44ebe8aa71e6ae0925cb70a8c53b21) --- modules/luci-base/luasrc/dispatcher.lua | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/modules/luci-base/luasrc/dispatcher.lua b/modules/luci-base/luasrc/dispatcher.lua index 6b10d49e5..32d34da01 100644 --- a/modules/luci-base/luasrc/dispatcher.lua +++ b/modules/luci-base/luasrc/dispatcher.lua @@ -623,6 +623,14 @@ local function merge_trees(node_a, node_b) node_a[k] = v end end + + if type(node_a.action) == "table" and + node_a.action.type == "firstchild" and + node_a.children == nil + then + node_a.satisfied = false + end + return node_a end -- 2.25.1