From: Jo-Philipp Wich Date: Fri, 2 Jul 2021 18:47:11 +0000 (+0200) Subject: luci-mod-network: fix saving bridge VLANs without member ports X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=f1f566bfe2a6b0960ba95a5ea05ca4353b766867;p=project%2Fluci.git luci-mod-network: fix saving bridge VLANs without member ports Calling `uci.set()` with an empty array yields an invalid argument error, make sure to pass `null` instead in this case. Signed-off-by: Jo-Philipp Wich --- diff --git a/modules/luci-mod-network/htdocs/luci-static/resources/tools/network.js b/modules/luci-mod-network/htdocs/luci-static/resources/tools/network.js index d13299777f..6248f7bf77 100644 --- a/modules/luci-mod-network/htdocs/luci-static/resources/tools/network.js +++ b/modules/luci-mod-network/htdocs/luci-static/resources/tools/network.js @@ -304,7 +304,7 @@ var cbiTagValue = form.Value.extend({ } } - uci.set('network', section_id, 'ports', ports); + uci.set('network', section_id, 'ports', ports.length ? ports : null); }, remove: function() {}