Topic on Extension talk:MultiBoilerplate

Help for MW 1.37.1 PHP Deprecated: Use of $wgParser was deprecated in MediaWiki 1.32.

5
Summary by FreedomFighterSparrow

Resolved - use master branch for MW 1.37

Mwgbell (talkcontribs)

Running MW 1.37.1; downloaded the latest version of MultiBoilerplate ad get this error (here is the callback stack), Any ideas?


[error] [a71b871f2b394167d7b81cbc] /wiki/index.php?boilerplate=Template%3AFamily-TraditionsBase&action=edit&title=2016-10-23   PHP Deprecated: Use of $wgParser was deprecated in MediaWiki 1.32. [Called from MediaWiki\HookContainer\HookContainer::callLegacyHook]

#0 [internal function]: MWExceptionHandler::handleError(integer, string, string, string, array)

#1 F:\wamp64\apps\mediawiki-1.37.1\includes\debug\MWDebug.php(375): trigger_error(string, integer)

#2 F:\wamp64\apps\mediawiki-1.37.1\includes\debug\MWDebug.php(349): MWDebug::sendRawDeprecated(string, boolean, string)

#3 F:\wamp64\apps\mediawiki-1.37.1\includes\debug\MWDebug.php(230): MWDebug::deprecatedMsg(string, string, string, integer)

#4 F:\wamp64\apps\mediawiki-1.37.1\includes\GlobalFunctions.php(1005): MWDebug::deprecated(string, string, string, integer)

#5 F:\wamp64\apps\mediawiki-1.37.1\includes\DeprecatedGlobal.php(58): wfDeprecated(string, string, boolean, integer)

#6 F:\wamp64\apps\mediawiki-1.37.1\includes\StubObject.php(223): DeprecatedGlobal->_newObject()

#7 F:\wamp64\apps\mediawiki-1.37.1\includes\StubObject.php(119): StubObject->_unstub(string, integer)

#8 F:\wamp64\apps\mediawiki-1.37.1\includes\StubObject.php(149): StubObject->_call(string, array)

#9 F:\wamp64\apps\mediawiki-1.37.1\extensions\MultiBoilerplate\MultiBoilerplate.hooks.php(142): StubObject->__call(string, array)

#10 F:\wamp64\apps\mediawiki-1.37.1\includes\HookContainer\HookContainer.php(338): MultiBoilerplateHooks::onEditPageShowEditFormInitial(EditPage, OutputPage)

#11 F:\wamp64\apps\mediawiki-1.37.1\includes\HookContainer\HookContainer.php(137): MediaWiki\HookContainer\HookContainer->callLegacyHook(string, array, array, array)

#12 F:\wamp64\apps\mediawiki-1.37.1\includes\HookContainer\HookRunner.php(1599): MediaWiki\HookContainer\HookContainer->run(string, array)

#13 F:\wamp64\apps\mediawiki-1.37.1\includes\EditPage.php(2900): MediaWiki\HookContainer\HookRunner->onEditPage__showEditForm_initial(EditPage, OutputPage)

#14 F:\wamp64\apps\mediawiki-1.37.1\includes\EditPage.php(722): EditPage->showEditForm()

#15 F:\wamp64\apps\mediawiki-1.37.1\includes\actions\EditAction.php(71): EditPage->edit()

#16 F:\wamp64\apps\mediawiki-1.37.1\includes\MediaWiki.php(543): EditAction->show()

#17 F:\wamp64\apps\mediawiki-1.37.1\includes\MediaWiki.php(320): MediaWiki->performAction(Article, Title)

#18 F:\wamp64\apps\mediawiki-1.37.1\includes\MediaWiki.php(930): MediaWiki->performRequest()

#19 F:\wamp64\apps\mediawiki-1.37.1\includes\MediaWiki.php(564): MediaWiki->main()

#20 F:\wamp64\apps\mediawiki-1.37.1\index.php(56): MediaWiki->run()

#21 F:\wamp64\apps\mediawiki-1.37.1\index.php(49): wfIndexMain()

#22 {main}

Mwgbell (talkcontribs)

So, I did a hack job on MultiBoilerplate.hooks.php;

Added


use MediaWiki\MediaWikiServices;

towards the beginning of the file (before the first Class define)


Changed this line:

      global $wgParser, $wgMultiBoilerplateOptions, $wgMultiBoilerplateOverwrite;

to this:

        global $wgMultiBoilerplateOptions, $wgMultiBoilerplateOverwrite;

And changed this line:

              $parser        = $wgParser->getFreshParser();  // Since MW 1.24

To this:

                $parser        = MediaWikiServices::getInstance()->getParser();  // Since MW 1.32


Seems to work for me now

FreedomFighterSparrow (talkcontribs)

This is my bad - I have a somewhat-modernized code base that I never uploaded (because gerrit keeps getting me confused). I've now uploaded it and waiting to seee how to actually merge it: gerrit:760931

Mwgbell (talkcontribs)

Thanks, and good luck!

FreedomFighterSparrow (talkcontribs)

Done - use the master branch for MW 1.37.