jenkins-bot has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/346548 )

Change subject: RC Filters: Disable defaults for legacy filters in structured UI
......................................................................


RC Filters: Disable defaults for legacy filters in structured UI

Some legacy filters are replaced in structured UI by new filters.
It's important that their default value doesn't cause them
to filter the results when they are not even visible to the
user.

Bug: T162158
Change-Id: I3ff09164bbc0d14283302aa37bdee2c7ef9f5eb3
---
M includes/changes/ChangesListBooleanFilter.php
M includes/specialpage/ChangesListSpecialPage.php
2 files changed, 9 insertions(+), 3 deletions(-)

Approvals:
  Catrope: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/includes/changes/ChangesListBooleanFilter.php 
b/includes/changes/ChangesListBooleanFilter.php
index 4117a11..851d173 100644
--- a/includes/changes/ChangesListBooleanFilter.php
+++ b/includes/changes/ChangesListBooleanFilter.php
@@ -136,10 +136,15 @@
        }
 
        /**
+        * Get the default value
+        *
+        * @param bool $structuredUI Are we currently showing the structured UI
         * @return bool|null Default value
         */
-       public function getDefault() {
-               return $this->defaultValue;
+       public function getDefault( $structuredUI = false ) {
+               return $this->isReplacedInStructuredUi && $structuredUI ?
+                       false :
+                       $this->defaultValue;
        }
 
        /**
diff --git a/includes/specialpage/ChangesListSpecialPage.php 
b/includes/specialpage/ChangesListSpecialPage.php
index ad9a248..d9472af 100644
--- a/includes/specialpage/ChangesListSpecialPage.php
+++ b/includes/specialpage/ChangesListSpecialPage.php
@@ -707,6 +707,7 @@
        public function getDefaultOptions() {
                $config = $this->getConfig();
                $opts = new FormOptions();
+               $structuredUI = $this->getUser()->getOption( 
'rcenhancedfilters' );
 
                // Add all filters
                foreach ( $this->filterGroups as $filterGroup ) {
@@ -716,7 +717,7 @@
                                $opts->add( $filterGroup->getName(), 
$filterGroup->getDefault() );
                        } else {
                                foreach ( $filterGroup->getFilters() as $filter 
) {
-                                       $opts->add( $filter->getName(), 
$filter->getDefault() );
+                                       $opts->add( $filter->getName(), 
$filter->getDefault( $structuredUI ) );
                                }
                        }
                }

-- 
To view, visit https://gerrit.wikimedia.org/r/346548
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I3ff09164bbc0d14283302aa37bdee2c7ef9f5eb3
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Sbisson <sbis...@wikimedia.org>
Gerrit-Reviewer: Catrope <r...@wikimedia.org>
Gerrit-Reviewer: Mattflaschen <mflasc...@wikimedia.org>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to