Fixed issue #944 - Remove all Users from Overview does not work.

This commit is contained in:
Rolf Schmidt 2017-05-29 13:49:17 +02:00
parent 2893910aba
commit 1a6c8ce0f3
3 changed files with 27 additions and 9 deletions

View file

@ -426,8 +426,11 @@ class App.ControllerForm extends App.Controller
delete param[item.name]
continue
# collect all params, push it to an array if already exists
# collect all params, push it to an array item.value already exists
value = item.value
if item.value
value = item.value.trim()
if item.type is 'boolean'
if value is ''
value = undefined

View file

@ -246,13 +246,27 @@ jQuery.fn.extend( {
var val = $elem.val();
var type = $elem.data('field-type');
return val == null ?
null :
jQuery.isArray( val ) ?
jQuery.map( val, function( val ) {
var result;
if ( val == null ) {
// be sure that also null values are transfered
// https://github.com/zammad/zammad/issues/944
if ( $elem.prop('multiple') ) {
result = { name: elem.name, value: null, type: type };
}
else {
result = null
}
}
else if ( jQuery.isArray( val ) ) {
result = jQuery.map( val, function( val ) {
return { name: elem.name, value: val.replace( rCRLF, "\r\n" ), type: type };
} ) :
{ name: elem.name, value: val.replace( rCRLF, "\r\n" ), type: type };
} );
}
else {
result = { name: elem.name, value: val.replace( rCRLF, "\r\n" ), type: type };
}
return result;
} ).get();
}
} );

View file

@ -28,6 +28,7 @@ test( "column_select check", function(assert) {
var params = App.ControllerForm.params(el)
var test_params = {
column_select1: null,
column_select2: ['aaa', 'bbb'],
column_select3: ['1', '2'],
}