Merge "RecentChangesLinked: Include title without subpage in form"
authorjenkins-bot <jenkins-bot@gerrit.wikimedia.org>
Thu, 21 Dec 2017 18:26:09 +0000 (18:26 +0000)
committerGerrit Code Review <gerrit@wikimedia.org>
Thu, 21 Dec 2017 18:26:09 +0000 (18:26 +0000)
includes/specialpage/ChangesListSpecialPage.php
includes/specials/SpecialRecentchangeslinked.php

index 65a03eb..303184d 100644 (file)
@@ -553,7 +553,7 @@ abstract class ChangesListSpecialPage extends SpecialPage {
        public function execute( $subpage ) {
                $this->rcSubpage = $subpage;
 
-               $this->considerActionsForDefaultSavedQuery();
+               $this->considerActionsForDefaultSavedQuery( $subpage );
 
                $opts = $this->getOptions();
                try {
@@ -629,8 +629,10 @@ abstract class ChangesListSpecialPage extends SpecialPage {
         * Check whether or not the page should load defaults, and if so, whether
         * a default saved query is relevant to be redirected to. If it is relevant,
         * redirect properly with all necessary query parameters.
+        *
+        * @param string $subpage
         */
-       protected function considerActionsForDefaultSavedQuery() {
+       protected function considerActionsForDefaultSavedQuery( $subpage ) {
                if ( !$this->isStructuredFilterUiEnabled() || $this->including() ) {
                        return;
                }
@@ -677,7 +679,7 @@ abstract class ChangesListSpecialPage extends SpecialPage {
                                        // but are still valid and requested in the URL
                                        $query = array_merge( $this->getRequest()->getValues(), $query );
                                        unset( $query[ 'title' ] );
-                                       $this->getOutput()->redirect( $this->getPageTitle()->getCanonicalURL( $query ) );
+                                       $this->getOutput()->redirect( $this->getPageTitle( $subpage )->getCanonicalURL( $query ) );
                                } else {
                                        // There's a default, but the version is not 2, and the server can't
                                        // actually recognize the query itself. This happens if it is before
index 9e0daf5..d4aef6c 100644 (file)
@@ -30,8 +30,6 @@ class SpecialRecentChangesLinked extends SpecialRecentChanges {
        /** @var bool|Title */
        protected $rclTargetTitle;
 
-       protected $rclTarget;
-
        function __construct() {
                parent::__construct( 'Recentchangeslinked' );
        }
@@ -46,7 +44,6 @@ class SpecialRecentChangesLinked extends SpecialRecentChanges {
 
        public function parseParameters( $par, FormOptions $opts ) {
                $opts['target'] = $par;
-               $this->rclTarget = $par;
        }
 
        /**
@@ -297,20 +294,6 @@ class SpecialRecentChangesLinked extends SpecialRecentChanges {
                return $this->prefixSearchString( $search, $limit, $offset );
        }
 
-       /**
-        * Get a self-referential title object
-        * with consideration to the given subpage.
-        *
-        * @param string|bool $subpage
-        * @return Title
-        * @since 1.23
-        */
-       public function getPageTitle( $subpage = false ) {
-               $subpage = $subpage ? $subpage : $this->rclTarget;
-
-               return parent::getPageTitle( $subpage );
-       }
-
        protected function outputNoResults() {
                if ( $this->getTargetTitle() === false ) {
                        $this->getOutput()->addHTML(