From 73cd7c98173dabf20ed88f57fff84f93d9c8f76b Mon Sep 17 00:00:00 2001 From: Alexandre Emsenhuber Date: Tue, 28 Feb 2012 21:12:38 +0000 Subject: [PATCH] * Don't execute the LinkBatch if there are now rows * Call methods directly on ResultWrapper instead of DatabaseBase --- includes/specials/SpecialDisambiguations.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/includes/specials/SpecialDisambiguations.php b/includes/specials/SpecialDisambiguations.php index 2b05fb6b61..8f780b5890 100644 --- a/includes/specials/SpecialDisambiguations.php +++ b/includes/specials/SpecialDisambiguations.php @@ -108,17 +108,17 @@ class DisambiguationsPage extends PageQueryPage { * @param $res */ function preprocessResults( $db, $res ) { + if ( !$res->numRows() ) { + return; + } + $batch = new LinkBatch; foreach ( $res as $row ) { $batch->add( $row->namespace, $row->title ); } $batch->execute(); - // Back to start for display - if ( $db->numRows( $res ) > 0 ) { - // If there are no rows we get an error seeking. - $db->dataSeek( $res, 0 ); - } + $res->seek( 0 ); } function formatResult( $skin, $result ) { -- 2.20.1