Page MenuHomePhabricator

Replace $wgParser in NukeDPL
Closed, ResolvedPublic

Description

$wgParser is being removed and replaced with MediaWikiServices::getParser(). This needs to be updated. Codesearch

Event Timeline

Change 561567 had a related patch set uploaded (by TheSandDoctor; owner: TheSandDoctor):
[mediawiki/extensions/NukeDPL@master] Replace $wgParser with MediaWikiServices

https://gerrit.wikimedia.org/r/561567

TheSandDoctor added a subscriber: Sophivorus.

@Sophivorus Could you please take a look at this? Thanks!

Change 561567 merged by jenkins-bot:
[mediawiki/extensions/NukeDPL@master] Replace $wgParser with MediaWikiServices

https://gerrit.wikimedia.org/r/561567

@TheSandDoctor I fixed some flaws in your patch that you may want to avoid on other extensions. For example, MediaWikiServices needs to be made available with:

use MediaWiki\MediaWikiServices;

Also, some MediaWikiServices methods (such as getParser) require an object context, which means you should get a MediaWikiServices instance before calling the method, like so:

$parser = MediaWikiServices::getInstance()->getParser();

Cheers!

@Sophivorus thanks! I will make corrections to the others. I was going off of the documentation in the parent task, but shall make the patches.