https://www.mediawiki.org/wiki/Special:Code/MediaWiki/112641
Revision: 112641
Author: ialex
Date: 2012-02-28 21:12:38 +0000 (Tue, 28 Feb 2012)
Log Message:
-----------
* Don't execute the LinkBatch if there are now rows
* Call methods directly on ResultWrapper instead of DatabaseBase
Modified Paths:
--------------
trunk/phase3/includes/specials/SpecialDisambiguations.php
Modified: trunk/phase3/includes/specials/SpecialDisambiguations.php
===================================================================
--- trunk/phase3/includes/specials/SpecialDisambiguations.php 2012-02-28
21:10:10 UTC (rev 112640)
+++ trunk/phase3/includes/specials/SpecialDisambiguations.php 2012-02-28
21:12:38 UTC (rev 112641)
@@ -108,17 +108,17 @@
* @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 ) {
_______________________________________________
MediaWiki-CVS mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs