Universal-Omega / PortableInfobox

GNU General Public License v3.0
12 stars 11 forks source link

In MediaWiki 1.39, PortableInfobox breaks when PageImages is installed, and horizontal groups are broken #89

Closed the-dragons-studio closed 1 year ago

the-dragons-studio commented 1 year ago

It seems that MediaWiki 1.39 has given rise to two bugs.

PortableInfobox attempts to utilise the PageImages extension within includes/services/Parser/MediaWikiParserServices.php, but this causes the following error because PortableInfobox attempts to call it statically: Error: Non-static method PageImages\Hooks\ParserFileProcessingHookHandlers::onParserModifyImageHTML() cannot be called statically

with the following stacktrace: `#0 C:\Apache24\htdocs\w\extensions\PortableInfobox\includes\services\Parser\Nodes\NodeMedia.php(154): PortableInfobox\Parser\MediaWikiParserService->addImage()

1 C:\Apache24\htdocs\w\extensions\PortableInfobox\includes\services\Parser\Nodes\NodeMedia.php(87): PortableInfobox\Parser\Nodes\NodeMedia->getImageData()

2 C:\Apache24\htdocs\w\extensions\PortableInfobox\includes\services\Parser\Nodes\NodeMedia.php(182): PortableInfobox\Parser\Nodes\NodeMedia->getData()

3 C:\Apache24\htdocs\w\extensions\PortableInfobox\includes\services\Parser\Nodes\Node.php(179): PortableInfobox\Parser\Nodes\NodeMedia->isEmpty()

4 [internal function]: PortableInfobox\Parser\Nodes\Node::PortableInfobox\Parser\Nodes{closure}()

5 C:\Apache24\htdocs\w\extensions\PortableInfobox\includes\services\Parser\Nodes\Node.php(180): array_filter()

6 C:\Apache24\htdocs\w\extensions\PortableInfobox\includes\services\Parser\Nodes\NodeInfobox.php(18): PortableInfobox\Parser\Nodes\Node->getRenderDataForChildren()

7 C:\Apache24\htdocs\w\extensions\PortableInfobox\includes\controllers\PortableInfoboxParserTagController.php(106): PortableInfobox\Parser\Nodes\NodeInfobox->getRenderData()

8 C:\Apache24\htdocs\w\extensions\PortableInfobox\includes\controllers\PortableInfoboxParserTagController.php(66): PortableInfoboxParserTagController->prepareInfobox()

9 C:\Apache24\htdocs\w\extensions\PortableInfobox\includes\controllers\PortableInfoboxParserTagController.php(131): PortableInfoboxParserTagController->render()

10 C:\Apache24\htdocs\w\includes\parser\Parser.php(4022): PortableInfoboxParserTagController->renderInfobox()

11 C:\Apache24\htdocs\w\includes\parser\PPFrame_Hash.php(354): Parser->extensionSubstitution()

12 C:\Apache24\htdocs\w\includes\parser\Parser.php(3316): PPFrame_Hash->expand()

13 C:\Apache24\htdocs\w\includes\parser\PPFrame_Hash.php(276): Parser->braceSubstitution()

14 C:\Apache24\htdocs\w\includes\parser\Parser.php(2954): PPFrame_Hash->expand()

15 C:\Apache24\htdocs\w\includes\parser\Parser.php(1609): Parser->replaceVariables()

16 C:\Apache24\htdocs\w\includes\parser\Parser.php(723): Parser->internalParse()

17 C:\Apache24\htdocs\w\includes\content\WikitextContentHandler.php(301): Parser->parse()

18 C:\Apache24\htdocs\w\includes\content\ContentHandler.php(1721): WikitextContentHandler->fillParserOutput()

19 C:\Apache24\htdocs\w\includes\content\Renderer\ContentRenderer.php(47): ContentHandler->getParserOutput()

20 C:\Apache24\htdocs\w\includes\Revision\RenderedRevision.php(266): MediaWiki\Content\Renderer\ContentRenderer->getParserOutput()

21 C:\Apache24\htdocs\w\includes\Revision\RenderedRevision.php(237): MediaWiki\Revision\RenderedRevision->getSlotParserOutputUncached()

22 C:\Apache24\htdocs\w\includes\Revision\RevisionRenderer.php(221): MediaWiki\Revision\RenderedRevision->getSlotParserOutput()

23 C:\Apache24\htdocs\w\includes\Revision\RevisionRenderer.php(158): MediaWiki\Revision\RevisionRenderer->combineSlotOutput()

24 [internal function]: MediaWiki\Revision\RevisionRenderer->MediaWiki\Revision{closure}()

25 C:\Apache24\htdocs\w\includes\Revision\RenderedRevision.php(199): call_user_func()

26 C:\Apache24\htdocs\w\includes\poolcounter\PoolWorkArticleView.php(91): MediaWiki\Revision\RenderedRevision->getRevisionParserOutput()

27 C:\Apache24\htdocs\w\includes\poolcounter\PoolWorkArticleViewCurrent.php(97): PoolWorkArticleView->renderRevision()

28 C:\Apache24\htdocs\w\includes\poolcounter\PoolCounterWork.php(162): PoolWorkArticleViewCurrent->doWork()

29 C:\Apache24\htdocs\w\includes\page\ParserOutputAccess.php(299): PoolCounterWork->execute()

30 C:\Apache24\htdocs\w\includes\page\Article.php(714): MediaWiki\Page\ParserOutputAccess->getParserOutput()

31 C:\Apache24\htdocs\w\includes\page\Article.php(528): Article->generateContentOutput()

32 C:\Apache24\htdocs\w\includes\actions\ViewAction.php(78): Article->view()

33 C:\Apache24\htdocs\w\includes\MediaWiki.php(542): ViewAction->show()

34 C:\Apache24\htdocs\w\includes\MediaWiki.php(322): MediaWiki->performAction()

35 C:\Apache24\htdocs\w\includes\MediaWiki.php(904): MediaWiki->performRequest()

36 C:\Apache24\htdocs\w\includes\MediaWiki.php(562): MediaWiki->main()

37 C:\Apache24\htdocs\w\index.php(50): MediaWiki->run()

38 C:\Apache24\htdocs\w\index.php(46): wfIndexMain()

39 {main}`

The current workaround that worked for me is commenting out the wfLoadExtension call to PageImages. Obviously, disabling an entire extension to fix this is not ideal, even if my wikis do not make use of the PageImages extension, so it would be nice to fix this symbiosis so that PortableInfobox correctly uses the non-static method.

In addition, horizontal groups are broken. Normally, the contents of parallel horizontal groups are meant to be neatly stacked side by side, but as of 1.39, they are clustered top to bottom, in a broken manner. This is demonstrated in the below screenshot. Note that I used Vector 2022 for this screenshot, but I tested five skins; Cosmos, Refreshed, Vector, MonoBook and Timeless and all demonstrate the broken infobox behaviour. Vector_2022_broken_horizontal_group

adgellida commented 1 year ago

Why is this extension crashed practically on each new mediawiki release? Thanks for temporal fix

Universal-Omega commented 1 year ago

I will look into this shortly.

Universal-Omega commented 1 year ago

90 should fix the fatal here (but also bumps requirement to minimum of 1.39, but I created other release branches for old releases)

the-dragons-studio commented 1 year ago

Thanks for that. Indeed, re-installing the extension fixes the fatal and I can now load PageImages again, although the stylesheet bug on horizontal groups remains.

Universal-Omega commented 1 year ago

Thanks for that. Indeed, re-installing the extension fixes the fatal and I can now load PageImages again, although the stylesheet bug on horizontal groups remains.

Do you mind opening another bug report for that second issue? I took this issue as the fatal, the other issue is another bug.

the-dragons-studio commented 1 year ago

Sure, I will do so when I next return home.