Fixed issue #944 - Remove all Users from Overview does not work.
This commit is contained in:
parent
2893910aba
commit
1a6c8ce0f3
3 changed files with 27 additions and 9 deletions
|
@ -426,8 +426,11 @@ class App.ControllerForm extends App.Controller
|
||||||
delete param[item.name]
|
delete param[item.name]
|
||||||
continue
|
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.trim()
|
value = item.value
|
||||||
|
if item.value
|
||||||
|
value = item.value.trim()
|
||||||
|
|
||||||
if item.type is 'boolean'
|
if item.type is 'boolean'
|
||||||
if value is ''
|
if value is ''
|
||||||
value = undefined
|
value = undefined
|
||||||
|
|
|
@ -246,13 +246,27 @@ jQuery.fn.extend( {
|
||||||
var val = $elem.val();
|
var val = $elem.val();
|
||||||
var type = $elem.data('field-type');
|
var type = $elem.data('field-type');
|
||||||
|
|
||||||
return val == null ?
|
var result;
|
||||||
null :
|
if ( val == null ) {
|
||||||
jQuery.isArray( val ) ?
|
|
||||||
jQuery.map( val, function( val ) {
|
// be sure that also null values are transfered
|
||||||
return { name: elem.name, value: val.replace( rCRLF, "\r\n" ), type: type };
|
// https://github.com/zammad/zammad/issues/944
|
||||||
} ) :
|
if ( $elem.prop('multiple') ) {
|
||||||
{ name: elem.name, value: val.replace( rCRLF, "\r\n" ), type: type };
|
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 };
|
||||||
|
} );
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
result = { name: elem.name, value: val.replace( rCRLF, "\r\n" ), type: type };
|
||||||
|
}
|
||||||
|
return result;
|
||||||
} ).get();
|
} ).get();
|
||||||
}
|
}
|
||||||
} );
|
} );
|
||||||
|
|
|
@ -28,6 +28,7 @@ test( "column_select check", function(assert) {
|
||||||
|
|
||||||
var params = App.ControllerForm.params(el)
|
var params = App.ControllerForm.params(el)
|
||||||
var test_params = {
|
var test_params = {
|
||||||
|
column_select1: null,
|
||||||
column_select2: ['aaa', 'bbb'],
|
column_select2: ['aaa', 'bbb'],
|
||||||
column_select3: ['1', '2'],
|
column_select3: ['1', '2'],
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue