Umherirrender has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/104551


Change subject: Special:Contributions RSS has 1 more than limit
......................................................................

Special:Contributions RSS has 1 more than limit

The extra one is used for navigation on Special:Contributions, but that
is not needed on the rss feed.

Bug: 57874
Change-Id: Id56b0da7e921df9cbdb09e90611d226bf224804d
---
M RELEASE-NOTES-1.23
M includes/api/ApiFeedContributions.php
2 files changed, 7 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/51/104551/1

diff --git a/RELEASE-NOTES-1.23 b/RELEASE-NOTES-1.23
index 8dd9923..9ed89ec 100644
--- a/RELEASE-NOTES-1.23
+++ b/RELEASE-NOTES-1.23
@@ -76,6 +76,7 @@
 * (bug 37812) ResourceLoader will notice when a module's definition changes and
   recompile it accordingly.
 * (bug 57201) SpecialRecentChangesFilters hook is now executed for feeds.
+* (bug 57874) Special:Contributions RSS has 1 more than limit.
 
 === API changes in 1.23 ===
 * (bug 54884) action=parse&prop=categories now indicates hidden and missing
diff --git a/includes/api/ApiFeedContributions.php 
b/includes/api/ApiFeedContributions.php
index bf69410..f90ba98 100644
--- a/includes/api/ApiFeedContributions.php
+++ b/includes/api/ApiFeedContributions.php
@@ -87,7 +87,13 @@
 
                $feedItems = array();
                if ( $pager->getNumRows() > 0 ) {
+                       $count = 0;
+                       $limit = $pager->getLimit();
                        foreach ( $pager->mResult as $row ) {
+                               // ContribsPager selects one more row for 
navigation, skip that row
+                               if ( ++$count > $limit ) {
+                                       break;
+                               }
                                $feedItems[] = $this->feedItem( $row );
                        }
                }

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Id56b0da7e921df9cbdb09e90611d226bf224804d
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Umherirrender <umherirrender_de...@web.de>

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

Reply via email to