From: florianschmidtwelzow Date: Tue, 24 Jun 2014 16:18:53 +0000 (+0200) Subject: Special:Watchlist: Don't try to render empty row X-Git-Tag: 1.31.0-rc.0~15265 X-Git-Url: http://git.cyclocoop.org//%22%22._DIR_PLUGIN_FULLCALENDAR.%22prive/themes/spip/images/event_edit.png/%22?a=commitdiff_plain;h=10da99d18d9f90d144ffbbf204124b71bcf7c628;p=lhc%2Fweb%2Fwiklou.git Special:Watchlist: Don't try to render empty row If no rows to render in table, show message and leave function before trying to render. Bug: 67025 Change-Id: Ica4ad670a130f31124ff644a2e1e50beea481c9b --- diff --git a/includes/specials/SpecialWatchlist.php b/includes/specials/SpecialWatchlist.php index 2aec8dfec2..9c28d0679f 100644 --- a/includes/specials/SpecialWatchlist.php +++ b/includes/specials/SpecialWatchlist.php @@ -331,6 +331,14 @@ class SpecialWatchlist extends ChangesListSpecialPage { $output->showLagWarning( $lag ); } + # If no rows to display, show message before try to render the list + if ( $rows->numRows() == 0 ) { + $output->wrapWikiMsg( + "
\n$1\n
", 'recentchanges-noresult' + ); + return; + } + $dbr->dataSeek( $rows, 0 ); $list = ChangesList::newFromContext( $this->getContext() ); @@ -370,13 +378,7 @@ class SpecialWatchlist extends ChangesListSpecialPage { } $s .= $list->endRecentChangesList(); - if ( $rows->numRows() == 0 ) { - $output->wrapWikiMsg( - "
\n$1\n
", 'recentchanges-noresult' - ); - } else { - $output->addHTML( $s ); - } + $output->addHTML( $s ); } /**