luci-base: uci.js: prevent sending empty uci set operations
authorJo-Philipp Wich <jo@mein.io>
Fri, 22 Jul 2022 22:10:17 +0000 (00:10 +0200)
committerJo-Philipp Wich <jo@mein.io>
Fri, 22 Jul 2022 22:10:17 +0000 (00:10 +0200)
commit25dcd0b77c4450b83cd8b8307397e58c34ebfcd1
tree16be341a081bb71482d4bdc6a28c8732c9c270a3
parent2771360108cb3e2011c7c9cb4921a9047ea70910
luci-base: uci.js: prevent sending empty uci set operations

Under certain circumstances, a staged uci option value might get unset
again before saving the config, leaving an empty section change set
behind, causing the save call to send an empty uci set request via rpc,
triggering an ubus code 4 (Resource not found) error.

In particular this prevented bridge VLANs from getting saved properly.

Fixes: #5876
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
modules/luci-base/htdocs/luci-static/resources/uci.js