Remove 'noexternallanglinks' check from `canHaveLanguages`

`noexternallanglinks` is a magic word that can be used to
suppress/modify the languages produced by wikibase [1]. Most importantly
though, languages can still appear even with the usage of this magic
word. Therefore, this check can be removed.

[1] https://www.mediawiki.org/wiki/Wikibase/Installation/Advanced_configuration#noexternallanglinks

Bug: T277517
Change-Id: I1f532b3e669564f570b47451693ddb15757a6101
This commit is contained in:
Nicholas Ray 2021-04-21 10:45:06 -06:00
parent 90da534616
commit 2ff3308ac4
1 changed files with 1 additions and 9 deletions

View File

@ -117,8 +117,7 @@ class SkinVector extends SkinMustache {
/**
* This should be upstreamed to the Skin class in core once the logic is finalized.
* Returns false if an editor has explicitly disabled languages on the page via the property
* `noexternallanglinks`, if the page is a special page without any languages, or if an action
* Returns false if the page is a special page without any languages, or if an action
* other than view is being used.
* @return bool
*/
@ -127,13 +126,6 @@ class SkinVector extends SkinMustache {
if ( $action !== 'view' ) {
return false;
}
// Wikibase introduces a magic word
// When upstreaming this should be Wikibase agnostic.
// https://www.mediawiki.org/wiki/Wikibase/Installation/Advanced_configuration#noexternallanglinks
// If the property is not set, continue safely through the other if statements.
if ( $this->getOutput()->getProperty( 'noexternallanglinks' ) ) {
return false;
}
$title = $this->getTitle();
// Defensive programming - if a special page has added languages explicitly, best to show it.
if ( $title && $title->isSpecialPage() && empty( $this->getLanguagesCached() ) ) {