From c8575ffd7ad5f003f09779ccc3435aeeb1f822cc Mon Sep 17 00:00:00 2001 From: Aaron Schulz Date: Wed, 2 Nov 2011 17:33:00 +0000 Subject: [PATCH] FU r101629, made Pager only call doBatchLookups() if there are rows --- includes/Pager.php | 13 ++++++++----- includes/actions/HistoryAction.php | 5 ----- 2 files changed, 8 insertions(+), 10 deletions(-) diff --git a/includes/Pager.php b/includes/Pager.php index bfb011c0a1..57eb926a0a 100644 --- a/includes/Pager.php +++ b/includes/Pager.php @@ -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 */ diff --git a/includes/actions/HistoryAction.php b/includes/actions/HistoryAction.php index 9efe953882..d2c71a31a2 100644 --- a/includes/actions/HistoryAction.php +++ b/includes/actions/HistoryAction.php @@ -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(); -- 2.20.1