RCFilters: Don't load JS or redirect when transcluding
authorRoan Kattouw <roan.kattouw@gmail.com>
Thu, 14 Dec 2017 02:04:12 +0000 (18:04 -0800)
committerRoan Kattouw <roan.kattouw@gmail.com>
Thu, 14 Dec 2017 02:04:12 +0000 (18:04 -0800)
We were changing the URL on every page that contained
{{Special:Recentchanges}}.

Bug: T181032
Change-Id: Ib4a0d3c1733da0bd0076aa43b91fc06939c51b75

includes/specialpage/ChangesListSpecialPage.php

index b6d1028..5993d10 100644 (file)
@@ -624,7 +624,7 @@ abstract class ChangesListSpecialPage extends SpecialPage {
         * redirect properly with all necessary query parameters.
         */
        protected function considerActionsForDefaultSavedQuery() {
-               if ( !$this->isStructuredFilterUiEnabled() ) {
+               if ( !$this->isStructuredFilterUiEnabled() || $this->including() ) {
                        return;
                }
 
@@ -697,7 +697,7 @@ abstract class ChangesListSpecialPage extends SpecialPage {
         */
        protected function includeRcFiltersApp() {
                $out = $this->getOutput();
-               if ( $this->isStructuredFilterUiEnabled() ) {
+               if ( $this->isStructuredFilterUiEnabled() && !$this->including() ) {
                        $jsData = $this->getStructuredFilterJsData();
 
                        $messages = [];
@@ -1642,7 +1642,7 @@ abstract class ChangesListSpecialPage extends SpecialPage {
                ] );
                $out->addModules( 'mediawiki.special.changeslist.legend.js' );
 
-               if ( $this->isStructuredFilterUiEnabled() ) {
+               if ( $this->isStructuredFilterUiEnabled() && !$this->including() ) {
                        $out->addModules( 'mediawiki.rcfilters.filters.ui' );
                        $out->addModuleStyles( 'mediawiki.rcfilters.filters.base.styles' );
                }