Correct the logic for the ULS settings cog for Vector 2022

Bug: T315036
Change-Id: I9fe711cee57ee07dabba5c04f3c7faa5eb82a2c4
This commit is contained in:
Jon Robson
2023-06-16 14:19:50 -07:00
committed by jenkins-bot
parent 39db802f78
commit bcbe6fc705

View File

@@ -529,11 +529,21 @@ class Hooks implements
return;
}
// @todo: document what this block is for.
if ( $skin->getSkinName() !== 'vector-2022' && $this->config->get( 'ULSPosition' ) !== 'interlanguage' ) {
// The ULS settings cog is only needed on projects which show the ULS button in the sidebar
// e.g. it is shown in the personal menu
if ( $this->config->get( 'ULSPosition' ) !== 'interlanguage' ) {
return;
}
// For Vector 2022, the ULS settings cog is not needed for projects
// where a dedicated language button in the header (VectorLanguageInHeader is true).
if ( $skin->getSkinName() === 'vector-2022' ) {
$languageInHeaderConfig = $skin->getConfig()->get( 'VectorLanguageInHeader' );
if ( $languageInHeaderConfig[ $skin->getUser()->isAnon() ? 'logged_out' : 'logged_in' ] ?? true ) {
return;
}
}
if ( !$this->isEnabled() ) {
return;
}