From 89cc9afb772490e67c188adbed09697571a758dc Mon Sep 17 00:00:00 2001 From: Moriel Schottlender Date: Tue, 13 Jun 2017 16:04:57 -0700 Subject: [PATCH] RCFilters: Send form info even for empty checkboxes Make sure the url params override previous ones in case they are empty, make sure we still send them through the fieldset form with an empty value, rather than not send them at all (and then they are being re-merged into the existing URL and become essentially 'sticky') Change-Id: I294dba17c5a5b792f5bf5064a76dedefa4d12557 --- .../ui/mw.rcfilters.ui.FormWrapperWidget.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/resources/src/mediawiki.rcfilters/ui/mw.rcfilters.ui.FormWrapperWidget.js b/resources/src/mediawiki.rcfilters/ui/mw.rcfilters.ui.FormWrapperWidget.js index d17fffffe6..7605faeaa6 100644 --- a/resources/src/mediawiki.rcfilters/ui/mw.rcfilters.ui.FormWrapperWidget.js +++ b/resources/src/mediawiki.rcfilters/ui/mw.rcfilters.ui.FormWrapperWidget.js @@ -72,9 +72,13 @@ // 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 ); -- 2.20.1