Merge "RCFilters: Send form info even for empty checkboxes"
authorjenkins-bot <jenkins-bot@gerrit.wikimedia.org>
Wed, 14 Jun 2017 01:36:59 +0000 (01:36 +0000)
committerGerrit Code Review <gerrit@wikimedia.org>
Wed, 14 Jun 2017 01:36:59 +0000 (01:36 +0000)
resources/src/mediawiki.rcfilters/ui/mw.rcfilters.ui.FormWrapperWidget.js

index d17ffff..7605fae 100644 (file)
 
                // Collect all data from form
                $( e.target ).find( 'input:not([type="hidden"],[type="submit"]), select' ).each( function () {
+                       var value = '';
+
                        if ( !$( this ).is( ':checkbox' ) || $( this ).is( ':checked' ) ) {
-                               data[ $( this ).prop( 'name' ) ] = $( this ).val();
+                               value = $( this ).val();
                        }
+
+                       data[ $( this ).prop( 'name' ) ] = value;
                } );
 
                this.controller.updateChangesList( data );