The URL parameters will internally parsed to true/false by FormOptions for
the SpecialNewPages class. However, FormOptions::getChangedValues() will also
return an array with values of type boolean. wfArrayToCgi() on the other hand,
according to the doc, does not output null and false values if an array is
passed to it (which is done through the LinkRenderer/Title).
This can be fixed by translating the values from a boolean true false to a true
false parsed as URL values (1 and 0). I did this in the SpecialNewPages itself,
as I'm pretty sure, that this does not belong to the FormOptions::getChangedValues()
function and not to the wfArrayToCgi() function (which would change a very basic
and documented functioning from a widely used method).
Bug: T158504
Change-Id: I6660373b002bdb3a03edaf3b64557ffac8f25c6c
$changed = $this->opts->getChangedValues();
unset( $changed['offset'] ); // Reset offset if query type changes
+ // wfArrayToCgi(), called from LinkRenderer/Title, will not output null and false values
+ // to the URL, which would omit some options (T158504). Fix it by explicitly setting them
+ // to 0 or 1.
+ $changed = array_map( function ( $value ) {
+ return $value ? '1' : '0';
+ }, $changed );
+
$self = $this->getPageTitle();
$linkRenderer = $this->getLinkRenderer();
foreach ( $filters as $key => $msg ) {