Umherirrender has uploaded a new change for review.

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


Change subject: Avoid empty batch in ListredirectsPage::preprocessResults
......................................................................

Avoid empty batch in ListredirectsPage::preprocessResults

Change-Id: Iaf371cdb1c0628a42996537d966165a0d7f92ad7
---
M includes/specials/SpecialListredirects.php
1 file changed, 5 insertions(+), 6 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/91/95791/1

diff --git a/includes/specials/SpecialListredirects.php 
b/includes/specials/SpecialListredirects.php
index 2c8792f..de05be4 100644
--- a/includes/specials/SpecialListredirects.php
+++ b/includes/specials/SpecialListredirects.php
@@ -76,20 +76,19 @@
         * @param ResultWrapper $res
         */
        function preprocessResults( $db, $res ) {
-               $batch = new LinkBatch;
+               if ( !$res->numRows() ) {
+                       return;
+               }
 
+               $batch = new LinkBatch;
                foreach ( $res as $row ) {
                        $batch->add( $row->namespace, $row->title );
                        $batch->addObj( $this->getRedirectTarget( $row ) );
                }
-
                $batch->execute();
 
                // Back to start for display
-               if ( $res->numRows() > 0 ) {
-                       // If there are no rows we get an error seeking.
-                       $db->dataSeek( $res, 0 );
-               }
+               $res->seek( 0 );
        }
 
        protected function getRedirectTarget( $row ) {

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Iaf371cdb1c0628a42996537d966165a0d7f92ad7
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