From cb6f69103c553f7d5505d22138bceb2ddb53bbc1 Mon Sep 17 00:00:00 2001 From: Siddharth VP Date: Sat, 26 Mar 2022 22:19:48 +0530 Subject: [PATCH] Use RequestContext::getActionName instead of the uncached ActionFactory::getActionName Also avoids injecting the ActionFactory service. Change-Id: I9a26aff0d3885470d6cd376ab870023bb377ac77 --- extension.json | 2 +- includes/GadgetLoadConditions.php | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/extension.json b/extension.json index 32ad0585..17a41f88 100644 --- a/extension.json +++ b/extension.json @@ -8,7 +8,7 @@ "descriptionmsg": "gadgets-desc", "license-name": "GPL-2.0-or-later", "requires": { - "MediaWiki": ">= 1.37.0" + "MediaWiki": ">= 1.38.0" }, "type": "other", "namespaces": [ diff --git a/includes/GadgetLoadConditions.php b/includes/GadgetLoadConditions.php index 58fde15e..60689291 100644 --- a/includes/GadgetLoadConditions.php +++ b/includes/GadgetLoadConditions.php @@ -22,7 +22,6 @@ namespace MediaWiki\Extension\Gadgets; * @file */ -use MediaWiki\MediaWikiServices; use OutputPage; use Skin; use User; @@ -46,7 +45,7 @@ class GadgetLoadConditions { $this->user = $out->getUser(); $this->target = $out->getTarget() ?? 'desktop'; $this->skin = $out->getSkin(); - $this->action = MediaWikiServices::getInstance()->getActionFactory()->getActionName( $out->getContext() ); + $this->action = $out->getContext()->getActionName(); $this->withGadgetParam = $out->getRequest()->getRawVal( 'withgadget' ); }