From 06977012324a0ed1ebf766270b0ed3162a719de5 Mon Sep 17 00:00:00 2001 From: Alexandre Emsenhuber Date: Thu, 10 May 2012 21:51:50 +0200 Subject: [PATCH] Various fixes to Special:Mostlinked. * Show descriptive error message on invalid title * Call methods directly on ResultWrapper instead of DatabaseBase Change-Id: Ia437e73546ce664395f07c4a10bad6f04fcfb5d7 --- includes/specials/SpecialMostlinked.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/includes/specials/SpecialMostlinked.php b/includes/specials/SpecialMostlinked.php index a16f0872b5..ef2cf74d45 100644 --- a/includes/specials/SpecialMostlinked.php +++ b/includes/specials/SpecialMostlinked.php @@ -62,12 +62,12 @@ class MostlinkedPage extends QueryPage { * @param $res */ function preprocessResults( $db, $res ) { - if( $db->numRows( $res ) > 0 ) { + if ( $res->numRows() > 0 ) { $linkBatch = new LinkBatch(); foreach ( $res as $row ) { $linkBatch->add( $row->namespace, $row->title ); } - $db->dataSeek( $res, 0 ); + $res->seek( 0 ); $linkBatch->execute(); } } @@ -94,7 +94,8 @@ class MostlinkedPage extends QueryPage { function formatResult( $skin, $result ) { $title = Title::makeTitleSafe( $result->namespace, $result->title ); if ( !$title ) { - return ''; + return Html::element( 'span', array( 'class' => 'mw-invalidtitle' ), + Linker::getInvalidTitleDescription( $this->getContext(), $result->namespace, $result->title ) ); } $link = Linker::link( $title ); $wlh = $this->makeWlhLink( $title, -- 2.20.1