WorkflowForm: Convert selection arrays to proper strings

This commit is contained in:
guerler
2015-04-08 18:47:10 -04:00
parent d0d1f1233a
commit e7b7281be7
3 changed files with 11 additions and 8 deletions
@@ -185,13 +185,16 @@ define(['utils/utils',
if (!Utils.validate(input_def.value)) {
input_def.value = '';
} else {
if (input_def.value instanceof Array) {
input_def.value = value.toString();
} else {
input_def.value = String(input_def.value).replace(/[\[\]'"\s]/g, '');
if (input_def.multiple) {
input_def.value = input_def.value.replace(/,/g, '\n');
if ($.isArray(input_def.value)) {
var str_value = '';
for (var i in input_def.value) {
str_value += String(input_def.value[i]);
if (!input_def.multiple) {
break;
}
str_value += '\n';
}
input_def.value = str_value;
}
}
}