ULS: Display "Page contents not supported" body in missing and talk pages

Instead of displaying the empty state for all non-content pages, we
should check whether the page is missing or if it's a talk page instead.

Also use the term "subject page" to align with existing functions
of Title and NamespaceInfo.

Bug: T316559
Bug: T326788
Change-Id: I0f50898b6e9817aee2bcfba38e69c67ae041a14b
This commit is contained in:
NikG
2023-01-16 11:40:18 +02:00
parent 53fd451cf9
commit 613276ca89

View File

@@ -172,10 +172,10 @@ class Hooks implements
$out->addModules( 'ext.uls.interface' );
$title = $out->getTitle();
$isContentPage = $title && $title->exists() && $title->isContentPage();
// if current page is not a content page, we should use a different layout inside ULS
$isMissingPage = !$title || !$title->exists();
// if current page doesn't exist or if it's a talk page, we should use a different layout inside ULS
// according to T316559. Add JS config variable here, to let frontend know, when this is the case
$config[ 'wgULSisLanguageSelectorEmpty' ] = !$isContentPage;
$config[ 'wgULSisLanguageSelectorEmpty' ] = $isMissingPage || $title->isTalkPage();
}
// This is added here, and not in onResourceLoaderGetConfigVars to allow skins and extensions