From: Aaron Schulz Date: Wed, 2 Nov 2011 17:33:00 +0000 (+0000) Subject: FU r101629, made Pager only call doBatchLookups() if there are rows X-Git-Tag: 1.31.0-rc.0~26757 X-Git-Url: https://git.cyclocoop.org/%27.WWW_URL.%27admin/?a=commitdiff_plain;h=c8575ffd7ad5f003f09779ccc3435aeeb1f822cc;p=lhc%2Fweb%2Fwiklou.git FU r101629, made Pager only call doBatchLookups() if there are rows --- 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();