Fixes #12352 - cater for just one item selected in a multiselect list

This commit is contained in:
Herb Miller 2016-11-21 12:15:17 +00:00
parent 0bc346436b
commit 1e8d9d4c95
1 changed files with 2 additions and 2 deletions

View File

@ -114,8 +114,8 @@
$( document.body ).trigger( 'wc_backbone_modal_before_update', this._target );
$.each( $( 'form', this.$el ).serializeArray(), function( index, item ) {
item.name = item.name.replace( '[]', '' );
if ( data.hasOwnProperty( item.name ) ) {
if ( item.name.indexOf( '[]' ) != -1 ) {
item.name = item.name.replace( '[]', '' );
data[ item.name ] = $.makeArray( data[ item.name ] );
data[ item.name ].push( item.value );
} else {