From 99c0e5b329f0ad632a5bfb0b0bad1d76300f6607 Mon Sep 17 00:00:00 2001 From: thiemowmde Date: Wed, 6 Nov 2024 14:42:12 +0100 Subject: [PATCH] Fix empty label on undeployed namespaces This can happen when edits in a namespace are still recorded in the database, but the extension that added the namespace got undeployed. We can at least show the namespace number then. Change-Id: Iccc7f40a6b602bb38a00205a982069685642a10d --- src/EditcountHTML.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/EditcountHTML.php b/src/EditcountHTML.php index aceb664..8d626db 100644 --- a/src/EditcountHTML.php +++ b/src/EditcountHTML.php @@ -79,7 +79,11 @@ class EditcountHTML extends Editcount { foreach ( $this->nscount as $ns => $edits ) { $fedits = $lang->formatNum( $edits ); - $fns = ( $ns == NS_MAIN ) ? $this->msg( 'blanknamespace' ) : $lang->getFormattedNsText( $ns ); + if ( $ns === NS_MAIN ) { + $fns = $this->msg( 'blanknamespace' ); + } else { + $fns = $lang->getFormattedNsText( $ns ) ?: $ns; + } $percent = wfPercent( $edits / $this->total * 100 ); $fpercent = $lang->formatNum( $percent ); $ret .= "