ensure multiselect always receives an array when setting its value, fixes #18734

This commit is contained in:
Arthur Schiwon 2015-12-07 15:14:49 +01:00
parent e44b164f40
commit 952f1f3e60
1 changed files with 5 additions and 1 deletions

View File

@ -198,9 +198,13 @@ OCA = OCA || {};
return; return;
} }
// deal with text area // special cases: deal with text area and multiselect
if ($element.is('textarea') && $.isArray(value)) { if ($element.is('textarea') && $.isArray(value)) {
value = value.join("\n"); value = value.join("\n");
} else if($element.hasClass(this.multiSelectPluginClass)) {
if(!_.isArray(value)) {
value = value.split("\n");
}
} }
if ($element.is('span')) { if ($element.is('span')) {