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-10-26 22:59:08 +0300
committerJo-Philipp Wich <jo@mein.io>2022-10-26 23:02:16 +0300
commita98e2ea17d5f1912e000817bd1085418d6ea8906 (patch)
treee57b2890de463250e01b72790b77710a0acc6583 /modules
parentaca4591753d9c94c139268923c2323070f79e659 (diff)
luci-lua-runtime: render cbi header/footer templates via ucode runtime
Trigger rendering of CBI header and footer templates via the ucode runtime `include()` in order to ensure that scope data is properly inherited from Lua templates (`cbi/header`) including ucode templates (`header`). This fixes automatic triggering of the config apply flow on legacy Lua CBI forms. Ref: https://github.com/openwrt/luci/pull/6056#issuecomment-1292396588 Signed-off-by: Jo-Philipp Wich <jo@mein.io>
Diffstat (limited to 'modules')
-rw-r--r--modules/luci-lua-runtime/luasrc/dispatcher.lua4
1 files changed, 2 insertions, 2 deletions
diff --git a/modules/luci-lua-runtime/luasrc/dispatcher.lua b/modules/luci-lua-runtime/luasrc/dispatcher.lua
index e009147f05..cd850aa365 100644
--- a/modules/luci-lua-runtime/luasrc/dispatcher.lua
+++ b/modules/luci-lua-runtime/luasrc/dispatcher.lua
@@ -267,7 +267,7 @@ function invoke_cbi_action(model, config, ...)
http:header("X-CBI-State", state or 0)
if not config.noheader then
- tpl.render("cbi/header", {state = state})
+ _G.L.include("cbi/header", {state = state})
end
local redirect
@@ -318,7 +318,7 @@ function invoke_cbi_action(model, config, ...)
end
if not config.nofooter then
- tpl.render("cbi/footer", {
+ _G.L.include("cbi/footer", {
flow = config,
pageaction = pageaction,
redirect = redirect,