Jump to content

Extension talk:MultiBoilerplate/Archive 2

About this board

Previous discussion was archived at Extension talk:MultiBoilerplate/Archive 1 on 2017-04-23.

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.

Fix for MW 1.34+ - Call to undefined method OutputPage::addWikiText()

4
198.181.18.21 (talkcontribs)

The following file needs these 2 modifications:

extensions\MultiBoilerplate\SpecialBoilerplates.php

Line 54 and Line 81:

Replace this:

$output->addWikiText( $boilerplates );

with this:

$output->addWikiTextAsInterface( $boilerplates );


The $output->addWikiText was deprecated and no longer available.

FreedomFighterSparrow (talkcontribs)

Hi, I think the problem here was my use of versions, and then not updating the extension for 3 years. If you use the appropriate branch (REL1_34 / REL1_35), this was fixed by a [User:Umherirrender]] back in 2019.

As I'm now finally updating my own wiki to 1.35, the code base for this extension will be overhauled.

198.181.18.22 (talkcontribs)

This fixed helped me in MW 1.35

FreedomFighterSparrow (talkcontribs)

There's no need to make a manual change; just use the appropriate branch (REL1_35).

Reply to "Fix for MW 1.34+ - Call to undefined method OutputPage::addWikiText()"

MultiBoilerplate for Wikimedia

3
Klein Muçi (talkcontribs)

Hello! I wanted to activate this extension for the Albanian Wikiquote as it looks like something really useful for our community but when I opened a Phab task for it, they said it couldn't be activated as it isn't currently deployed on the Wikimedia sites. See here: https://phabricator.wikimedia.org/T243604. Can you help with this process, @FreedomFighterSparrow?

FreedomFighterSparrow (talkcontribs)

Hi, thanks for emailing me - I just failed to notice this message. While I still maintain this extension, I just make sure it continues to work with new MediaWiki versions. Following requirements for deployment on Wikimedia takes a lot more effort, and as you were told, requires a sponsor. I've had bad experience getting even small code changed to be merged into Wikimedia-deployed extensions in the past, and I do not believe I will have the time or energy to work through that list. Sorry! If there's something specific that needs to be done - bugfixes, security enhancements - I will do those, of course.

Klein Muçi (talkcontribs)

Oh, I see. Well, at least I learned something more on the Wikimedia extensions' topic. Thank you for answering anyway! :)

Reply to "MultiBoilerplate for Wikimedia"
PhotographerTom (talkcontribs)

Is it possible to add the drop down list to Visual editor so we don't have to create the page with Enhanced editor, save it, and then make changes with Visual editor?

FreedomFighterSparrow (talkcontribs)

Sorry for the late response - while I don't imagine it should be too difficult to do so, it requires testing with Visual Editor, which I'm not using right now; I won't be able to look into it any time soon.

Reply to "Visual editor"
Rob Kam (talkcontribs)

A boilerplate namespace can work fine, e.g. (after NS_BOILERPLATE and NS_BOILERPLATE_TALK have been defined), instead of

* Generic page|Template:Generic page

have

* Generic page|Boilerplate:Generic page
FreedomFighterSparrow (talkcontribs)

What is your use case? Do you have so many boilerplates? I'm asking because a lot of extenasions define namespaces, and their numbers tend to collide over time, so if there's no real need, I'd rather not define a new namespace.

Rob Kam (talkcontribs)

Only that it seems tidier to me. I've a handful of boilerplates but many templates. I suspected there might be a reason for caution.

FreedomFighterSparrow (talkcontribs)

It's not that much of an problem, I'm just not sure it's worth it. Since both Special:Boilerplates and Special:PrefixIndex allow you to find all of your boilerplates, the current setup isn't really messy.

Reply to "Boilerplate namespace"
There are no older topics