From 561de16a5d889a91142c38e3ea18f1803252f0a9 Mon Sep 17 00:00:00 2001 From: Jo-Philipp Wich Date: Tue, 28 Apr 2020 09:46:22 +0200 Subject: [PATCH] luci-base: form.js: allow secondary configs to fail loading Ref: https://forum.openwrt.org/t/luci-rpc-error/61760 Signed-off-by: Jo-Philipp Wich (backported from commit 17ffc84a2903c2354543cd0fb575a82e36e076fd) --- .../luci-base/htdocs/luci-static/resources/form.js | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/modules/luci-base/htdocs/luci-static/resources/form.js b/modules/luci-base/htdocs/luci-static/resources/form.js index 01c9ba8cd..c1331fb34 100644 --- a/modules/luci-base/htdocs/luci-static/resources/form.js +++ b/modules/luci-base/htdocs/luci-static/resources/form.js @@ -520,8 +520,16 @@ var CBIMap = CBIAbstractElement.extend(/** @lends LuCI.form.Map.prototype */ { * an error. */ load: function() { - return this.data.load(this.parsechain || [ this.config ]) - .then(this.loadChildren.bind(this)); + var loadTasks = [], + configs = this.parsechain || [ this.config ]; + + loadTasks.push.apply(loadTasks, configs.map(L.bind(function(config, i) { + return i ? L.resolveDefault(this.data.load(config)) : this.data.load(config); + }, this))); + + return Promise.all(loadTasks).then(L.bind(function(res) { + return this.loadChildren(); + }, this)); }, /** -- 2.25.1