From: Alexandre Emsenhuber Date: Tue, 28 Feb 2012 21:12:38 +0000 (+0000) Subject: * Don't execute the LinkBatch if there are now rows X-Git-Tag: 1.31.0-rc.0~24464 X-Git-Url: http://git.cyclocoop.org/%40spipnet%40?a=commitdiff_plain;h=73cd7c98173dabf20ed88f57fff84f93d9c8f76b;p=lhc%2Fweb%2Fwiklou.git * Don't execute the LinkBatch if there are now rows * Call methods directly on ResultWrapper instead of DatabaseBase --- 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 ) {