From 08a2b27df5e282a6b5221fbe72f700523c7b0913 Mon Sep 17 00:00:00 2001 From: Jo-Philipp Wich Date: Fri, 6 Apr 2018 09:35:39 +0200 Subject: [PATCH] luci-app-mwan3: fix legacy uci api usage Explicitely require libuci-lua in model classes that use legacy /var/state cursor handling. Also add a specific dependency on libuci-lua to the luci-app-mwan3 Makefile in preparation of the upcoming default removal of libuci-lua. Finally fix the post data dispatching on the notification tab, see #1722 for reference. Fixes #1726. Signed-off-by: Jo-Philipp Wich --- applications/luci-app-mwan3/Makefile | 2 +- applications/luci-app-mwan3/luasrc/controller/mwan3.lua | 2 +- applications/luci-app-mwan3/luasrc/model/cbi/mwan/interface.lua | 1 + applications/luci-app-mwan3/luasrc/model/cbi/mwan/policy.lua | 1 + applications/luci-app-mwan3/luasrc/model/cbi/mwan/rule.lua | 1 + 5 files changed, 5 insertions(+), 2 deletions(-) diff --git a/applications/luci-app-mwan3/Makefile b/applications/luci-app-mwan3/Makefile index d65cd3af16..c719cb134c 100644 --- a/applications/luci-app-mwan3/Makefile +++ b/applications/luci-app-mwan3/Makefile @@ -7,7 +7,7 @@ include $(TOPDIR)/rules.mk LUCI_TITLE:=LuCI support for the MWAN3 multiwan hotplug script -LUCI_DEPENDS:=+mwan3 +luci-mod-admin-full +luci-app-firewall +luci-lib-nixio +LUCI_DEPENDS:=+mwan3 +libuci-lua +luci-mod-admin-full +luci-app-firewall +luci-lib-nixio LUCI_PKGARCH:=all PKG_LICENSE:=GPLv2 diff --git a/applications/luci-app-mwan3/luasrc/controller/mwan3.lua b/applications/luci-app-mwan3/luasrc/controller/mwan3.lua index 27dc984eb4..d8fba79c79 100644 --- a/applications/luci-app-mwan3/luasrc/controller/mwan3.lua +++ b/applications/luci-app-mwan3/luasrc/controller/mwan3.lua @@ -56,7 +56,7 @@ function index() arcombine(cbi("mwan/rule"), cbi("mwan/ruleconfig")), _("Rules"), 40).leaf = true entry({"admin", "network", "mwan", "notify"}, - cbi("mwan/notify"), + form("mwan/notify"), _("Notification"), 50).leaf = true end diff --git a/applications/luci-app-mwan3/luasrc/model/cbi/mwan/interface.lua b/applications/luci-app-mwan3/luasrc/model/cbi/mwan/interface.lua index 556a4f7010..8564231c87 100644 --- a/applications/luci-app-mwan3/luasrc/model/cbi/mwan/interface.lua +++ b/applications/luci-app-mwan3/luasrc/model/cbi/mwan/interface.lua @@ -3,6 +3,7 @@ -- Licensed to the public under the GNU General Public License v2. dsp = require "luci.dispatcher" +uci = require "uci" function interfaceWarnings(overview, count, iface_max) diff --git a/applications/luci-app-mwan3/luasrc/model/cbi/mwan/policy.lua b/applications/luci-app-mwan3/luasrc/model/cbi/mwan/policy.lua index c4567f756b..b7a90aa93a 100644 --- a/applications/luci-app-mwan3/luasrc/model/cbi/mwan/policy.lua +++ b/applications/luci-app-mwan3/luasrc/model/cbi/mwan/policy.lua @@ -3,6 +3,7 @@ -- Licensed to the public under the GNU General Public License v2. dsp = require "luci.dispatcher" +uci = require "uci" function policyCheck() diff --git a/applications/luci-app-mwan3/luasrc/model/cbi/mwan/rule.lua b/applications/luci-app-mwan3/luasrc/model/cbi/mwan/rule.lua index fb885f8b37..f0b94bd0bb 100644 --- a/applications/luci-app-mwan3/luasrc/model/cbi/mwan/rule.lua +++ b/applications/luci-app-mwan3/luasrc/model/cbi/mwan/rule.lua @@ -3,6 +3,7 @@ -- Licensed to the public under the GNU General Public License v2. dsp = require "luci.dispatcher" +uci = require "uci" function ruleCheck() -- 2.30.2