FU r101629, made Pager only call doBatchLookups() if there are rows
authorAaron Schulz <aaron@users.mediawiki.org>
Wed, 2 Nov 2011 17:33:00 +0000 (17:33 +0000)
committerAaron Schulz <aaron@users.mediawiki.org>
Wed, 2 Nov 2011 17:33:00 +0000 (17:33 +0000)
includes/Pager.php
includes/actions/HistoryAction.php

index bfb011c..57eb926 100644 (file)
@@ -329,9 +329,12 @@ abstract class IndexPager extends ContextSource implements Pager {
                if ( !$this->mQueryDone ) {
                        $this->doQuery();
                }
-               # Do any special query batches before display
-               $this->doBatchLookups();
-               
+
+               if ( $this->mResult->numRows() ) {
+                       # Do any special query batches before display
+                       $this->doBatchLookups();
+               }
+
                # Don't use any extra rows returned by the query
                $numRows = min( $this->mResult->numRows(), $this->mLimit );
 
@@ -389,8 +392,8 @@ abstract class IndexPager extends ContextSource implements Pager {
 
        /**
         * Called from getBody(), before getStartBody() is called and
-        * after doQuery() was called. This will be called even if there
-        * are no rows in the result set.
+        * after doQuery() was called. This will be called only if there
+        * are rows in the result set.
         *
         * @return void
         */
index 9efe953..d2c71a3 100644 (file)
@@ -385,11 +385,6 @@ class HistoryPager extends ReverseChronologicalPager {
        }
 
        function doBatchLookups() {
-               # No results? Nothing to batch
-               if ( !$this->mResult->numRows() ) {
-                       return;
-               }
-
                # Do a link batch query
                $this->mResult->seek( 0 );
                $batch = new LinkBatch();