jenkins-bot has submitted this change and it was merged.

Change subject: Special:Contributions: add all params to feed URL
......................................................................


Special:Contributions: add all params to feed URL

On Special:Contributions, the parameters namespace, year, month,
tagfilter, deletedonly, toponly are not applied to the feed link in
the toolbox
(action=feedcontributions).

Bug: 54093
Change-Id: Ib070b53786360d1c4911e0e4b50e61140466526c
---
M includes/specials/SpecialContributions.php
1 file changed, 29 insertions(+), 26 deletions(-)

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



diff --git a/includes/specials/SpecialContributions.php 
b/includes/specials/SpecialContributions.php
index b5b67c9..c594807 100644
--- a/includes/specials/SpecialContributions.php
+++ b/includes/specials/SpecialContributions.php
@@ -132,34 +132,37 @@
                }
 
                $feedType = $request->getVal( 'feed' );
+
+               $feedParams = array(
+                       'action' => 'feedcontributions',
+                       'user' => $target,
+               );
+               if ( $this->opts['topOnly'] ) {
+                       $feedParams['toponly'] = true;
+               }
+               if ( $this->opts['deletedOnly'] ) {
+                       $feedParams['deletedonly'] = true;
+               }
+               if ( $this->opts['tagfilter'] !== '' ) {
+                       $feedParams['tagfilter'] = $this->opts['tagfilter'];
+               }
+               if ( $this->opts['namespace'] !== '' ) {
+                       $feedParams['namespace'] = $this->opts['namespace'];
+               }
+               // Don't use year and month for the feed URL, but pass them on 
if
+               // we redirect to API (if $feedType is specified)
+               if ( $feedType && $this->opts['year'] !== null ) {
+                       $feedParams['year'] = $this->opts['year'];
+               }
+               if ( $feedType && $this->opts['month'] !== null ) {
+                       $feedParams['month'] = $this->opts['month'];
+               }
+
                if ( $feedType ) {
                        // Maintain some level of backwards compatability
                        // If people request feeds using the old parameters, 
redirect to API
-                       $apiParams = array(
-                               'action' => 'feedcontributions',
-                               'feedformat' => $feedType,
-                               'user' => $target,
-                       );
-                       if ( $this->opts['topOnly'] ) {
-                               $apiParams['toponly'] = true;
-                       }
-                       if ( $this->opts['deletedOnly'] ) {
-                               $apiParams['deletedonly'] = true;
-                       }
-                       if ( $this->opts['tagfilter'] !== '' ) {
-                               $apiParams['tagfilter'] = 
$this->opts['tagfilter'];
-                       }
-                       if ( $this->opts['namespace'] !== '' ) {
-                               $apiParams['namespace'] = 
$this->opts['namespace'];
-                       }
-                       if ( $this->opts['year'] !== null ) {
-                               $apiParams['year'] = $this->opts['year'];
-                       }
-                       if ( $this->opts['month'] !== null ) {
-                               $apiParams['month'] = $this->opts['month'];
-                       }
-
-                       $url = wfAppendQuery( wfScript( 'api' ), $apiParams );
+                       $feedParams['feedformat'] = $feedType;
+                       $url = wfAppendQuery( wfScript( 'api' ), $feedParams );
 
                        $out->redirect( $url, '301' );
 
@@ -167,7 +170,7 @@
                }
 
                // Add RSS/atom links
-               $this->addFeedLinks( array( 'action' => 'feedcontributions', 
'user' => $target ) );
+               $this->addFeedLinks( $feedParams );
 
                if ( wfRunHooks( 'SpecialContributionsBeforeMainOutput', array( 
$id, $userObj, $this ) ) ) {
                        if ( !$this->including() ) {

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Ib070b53786360d1c4911e0e4b50e61140466526c
Gerrit-PatchSet: 5
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: MrBlueSky <mrblue...@wikipedia.be>
Gerrit-Reviewer: Anomie <bjor...@wikimedia.org>
Gerrit-Reviewer: Brian Wolff <bawolff...@gmail.com>
Gerrit-Reviewer: MrBlueSky <mrblue...@wikipedia.be>
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