Use RequestContext::getActionName instead of the uncached ActionFactory::getActionName

Also avoids injecting the ActionFactory service.

Change-Id: I9a26aff0d3885470d6cd376ab870023bb377ac77
This commit is contained in:
Siddharth VP 2022-03-26 22:19:48 +05:30 committed by Krinkle
parent 699270148c
commit cb6f69103c
2 changed files with 2 additions and 3 deletions

View file

@ -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": [

View file

@ -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' );
}