From 59fac4cf16b718fa5ae09048af30f059dc11129d Mon Sep 17 00:00:00 2001 From: "Eloy Lafuente (stronk7)" Date: Mon, 26 Sep 2016 23:16:15 +0200 Subject: [PATCH] MDL-56127 forms: multiple select dependencies fixed This is a fix for a regressions introduced by MDL-54778. It seems that escaped all our tests because there isn't any case of such a dependency in core, but Daniele Cordella was facing it within his surveypro module. --- lib/form/form.js | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/form/form.js b/lib/form/form.js index 268fba2143c..2e4357b9dc0 100644 --- a/lib/form/form.js +++ b/lib/form/form.js @@ -496,6 +496,7 @@ if (typeof M.form.dependencyManager === 'undefined') { // Multiple selects can have one or more value assigned. A pipe (|) is used as a value separator // when multiple values have to be selected at the same time. values = value.split('|'); + selected = []; this.get('options').each(function() { if (this.get('selected')) { selected[selected.length] = this.get('value');