From 89f24d8d67973c9ed520e6cc0bf766007d903c02 Mon Sep 17 00:00:00 2001 From: Raimond Spekking Date: Wed, 2 Apr 2008 12:20:01 +0000 Subject: [PATCH] Fix a regression from r32685: Show a nice error message instead of a useless navigation bar if no log lines available. --- includes/SpecialLog.php | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/includes/SpecialLog.php b/includes/SpecialLog.php index bb9e2de111..f77b20e26a 100644 --- a/includes/SpecialLog.php +++ b/includes/SpecialLog.php @@ -40,14 +40,20 @@ function wfSpecialLog( $par = '' ) { $loglist->showHeader( $wgOut, $pager->getType() ); # Show form options $loglist->showOptions( $wgOut, $pager->getType(), $pager->getUser(), $pager->getPage(), $pager->getPattern() ); + # Insert list - $wgOut->addHTML( - $pager->getNavigationBar() . - $loglist->beginLogEventList() . - $pager->getBody() . - $loglist->endLogEventList() . - $pager->getNavigationBar() - ); + $logBody = $pager->getBody(); + if( $logBody ) { + $wgOut->addHTML( + $pager->getNavigationBar() . + $loglist->beginLogEventList() . + $logBody . + $loglist->endLogEventList() . + $pager->getNavigationBar() + ); + } else { + $wgOut->addWikiMsg( 'logempty' ); + } } /** -- 2.20.1