luci-app-adblock: fix SimpleForm page delegation
authorJo-Philipp Wich <jo@mein.io>
Thu, 5 Apr 2018 17:21:50 +0000 (19:21 +0200)
committerJo-Philipp Wich <jo@mein.io>
Thu, 5 Apr 2018 17:21:50 +0000 (19:21 +0200)
Invoke the SimpleForm models using the form() action, not the cbi() ones.
This avoids the extraneous rendering of the cbi header template, avoiding
rejected save operations due to duplicated token value.

Fixes #1722.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
applications/luci-app-adblock/luasrc/controller/adblock.lua

index 763c0b4b95188d92b2c7a3aea28e9fd31c06e7eb..10110666c3ae23578a013103cfff82798d4322ec 100644 (file)
@@ -15,9 +15,9 @@ function index()
        entry({"admin", "services", "adblock", "tab_from_cbi"}, cbi("adblock/overview_tab", {hideresetbtn=true, hidesavebtn=true}), _("Overview"), 10).leaf = true
        entry({"admin", "services", "adblock", "logfile"}, call("logread"), _("View Logfile"), 20).leaf = true
        entry({"admin", "services", "adblock", "advanced"}, firstchild(), _("Advanced"), 100)
-       entry({"admin", "services", "adblock", "advanced", "blacklist"}, cbi("adblock/blacklist_tab"), _("Edit Blacklist"), 110).leaf = true
-       entry({"admin", "services", "adblock", "advanced", "whitelist"}, cbi("adblock/whitelist_tab"), _("Edit Whitelist"), 120).leaf = true
-       entry({"admin", "services", "adblock", "advanced", "configuration"}, cbi("adblock/configuration_tab"), _("Edit Configuration"), 130).leaf = true
+       entry({"admin", "services", "adblock", "advanced", "blacklist"}, form("adblock/blacklist_tab"), _("Edit Blacklist"), 110).leaf = true
+       entry({"admin", "services", "adblock", "advanced", "whitelist"}, form("adblock/whitelist_tab"), _("Edit Whitelist"), 120).leaf = true
+       entry({"admin", "services", "adblock", "advanced", "configuration"}, form("adblock/configuration_tab"), _("Edit Configuration"), 130).leaf = true
        entry({"admin", "services", "adblock", "advanced", "query"}, template("adblock/query"), _("Query domains"), 140).leaf = true
        entry({"admin", "services", "adblock", "advanced", "result"}, call("queryData"), nil, 150).leaf = true
 end