r101640 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r101639‎ | r101640 | r101641 >
Date:17:33, 2 November 2011
Author:aaron
Status:ok
Tags:
Comment:
FU r101629, made Pager only call doBatchLookups() if there are rows
Modified paths:
  • /trunk/phase3/includes/Pager.php (modified) (history)
  • /trunk/phase3/includes/actions/HistoryAction.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/actions/HistoryAction.php
@@ -385,11 +385,6 @@
386386 }
387387
388388 function doBatchLookups() {
389 - # No results? Nothing to batch
390 - if ( !$this->mResult->numRows() ) {
391 - return;
392 - }
393 -
394389 # Do a link batch query
395390 $this->mResult->seek( 0 );
396391 $batch = new LinkBatch();
Index: trunk/phase3/includes/Pager.php
@@ -329,9 +329,12 @@
330330 if ( !$this->mQueryDone ) {
331331 $this->doQuery();
332332 }
333 - # Do any special query batches before display
334 - $this->doBatchLookups();
335 -
 333+
 334+ if ( $this->mResult->numRows() ) {
 335+ # Do any special query batches before display
 336+ $this->doBatchLookups();
 337+ }
 338+
336339 # Don't use any extra rows returned by the query
337340 $numRows = min( $this->mResult->numRows(), $this->mLimit );
338341
@@ -389,8 +392,8 @@
390393
391394 /**
392395 * Called from getBody(), before getStartBody() is called and
393 - * after doQuery() was called. This will be called even if there
394 - * are no rows in the result set.
 396+ * after doQuery() was called. This will be called only if there
 397+ * are rows in the result set.
395398 *
396399 * @return void
397400 */

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r101629Followup r100305, don't try to do a batch query for an empty result (which w...johnduhart15:15, 2 November 2011

Status & tagging log