mirror of
https://github.com/StarCitizenTools/mediawiki-skins-Citizen.git
synced 2024-11-24 06:24:22 +00:00
fix(core): don't use getActionName
< MW 1.38
getActionName does not exist before MW 1.38, use getAction instead Bug: #459
This commit is contained in:
parent
176adba1fb
commit
bbf7fa8b34
|
@ -25,9 +25,11 @@ declare( strict_types=1 );
|
|||
|
||||
namespace Citizen\Partials;
|
||||
|
||||
use ContextSource;
|
||||
use Exception;
|
||||
use ExtensionRegistry;
|
||||
use MediaWiki\MediaWikiServices;
|
||||
use Skin;
|
||||
use SkinTemplate;
|
||||
|
||||
final class PageTools extends Partial {
|
||||
|
@ -166,9 +168,18 @@ final class PageTools extends Partial {
|
|||
private function canHaveLanguages(): bool {
|
||||
$skin = $this->skin;
|
||||
|
||||
if ( $skin->getContext()->getActionName() !== 'view' ) {
|
||||
return false;
|
||||
if ( method_exists( Skin::class, 'getActionName' ) ) {
|
||||
// >= MW 1.38
|
||||
if ( $skin->getContext()->getActionName() !== 'view' ) {
|
||||
return false;
|
||||
}
|
||||
} else {
|
||||
// < MW 1.38
|
||||
if ( $skin->getContext()->getAction() !== 'view' ) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
$title = $skin->getTitle();
|
||||
// Defensive programming - if a special page has added languages explicitly, best to show it.
|
||||
if ( $title && $title->isSpecialPage() && empty( $this->getLanguagesCached() ) ) {
|
||||
|
|
Loading…
Reference in a new issue