alex4401 / mediawiki-extensions-DataMaps

Interactive data maps extension without extra services needed.
https://mediawiki.org/wiki/Extension:DataMaps
Other
6 stars 5 forks source link

Error: Non-static method cannot be called statically #207

Closed daflyinbed closed 1 year ago

daflyinbed commented 1 year ago

Describe the bug Error: Non-static method MediaWiki\Extension\DataMaps\Rendering\ParserFunction_EmbedDataMap::getRenderOptions() cannot be called statically

To Reproduce save {{DataMap: test}} Expected behavior save success

Additional context MediaWiki 1.39.4 (3a5790e) PHP 8.1.22 (fpm-fcgi) Interactive Data Maps 0.16.10 (a229dea)

Call Stack

Error: Non-static method MediaWiki\Extension\DataMaps\Rendering\ParserFunction_EmbedDataMap::getRenderOptions() cannot be called statically

Backtrace:

from /var/www/html/extensions/DataMaps/includes/Rendering/ParserFunction_EmbedDataMap.php(19)
#0 /var/www/html/includes/parser/Parser.php(3437): MediaWiki\Extension\DataMaps\Rendering\ParserFunction_EmbedDataMap::run()
#1 /var/www/html/includes/parser/Parser.php(3122): Parser->callParserFunction()
#2 /var/www/html/includes/parser/PPFrame_Hash.php(275): Parser->braceSubstitution()
#3 /var/www/html/includes/parser/Parser.php(2951): PPFrame_Hash->expand()
#4 /var/www/html/includes/parser/Parser.php(1609): Parser->replaceVariables()
#5 /var/www/html/includes/parser/Parser.php(723): Parser->internalParse()
#6 /var/www/html/includes/content/WikitextContentHandler.php(301): Parser->parse()
#7 /var/www/html/includes/content/ContentHandler.php(1721): WikitextContentHandler->fillParserOutput()
#8 /var/www/html/includes/content/Renderer/ContentRenderer.php(47): ContentHandler->getParserOutput()
#9 /var/www/html/includes/Revision/RenderedRevision.php(266): MediaWiki\Content\Renderer\ContentRenderer->getParserOutput()
#10 /var/www/html/includes/Revision/RenderedRevision.php(237): MediaWiki\Revision\RenderedRevision->getSlotParserOutputUncached()
#11 /var/www/html/includes/Revision/RevisionRenderer.php(221): MediaWiki\Revision\RenderedRevision->getSlotParserOutput()
#12 /var/www/html/includes/Revision/RevisionRenderer.php(158): MediaWiki\Revision\RevisionRenderer->combineSlotOutput()
#13 [internal function]: MediaWiki\Revision\RevisionRenderer->MediaWiki\Revision\{closure}()
#14 /var/www/html/includes/Revision/RenderedRevision.php(199): call_user_func()
#15 /var/www/html/includes/Storage/DerivedPageDataUpdater.php(1430): MediaWiki\Revision\RenderedRevision->getRevisionParserOutput()
#16 /var/www/html/extensions/SpamBlacklist/includes/Hooks.php(74): MediaWiki\Storage\DerivedPageDataUpdater->getParserOutputForMetaData()
#17 /var/www/html/includes/HookContainer/HookContainer.php(160): MediaWiki\Extension\SpamBlacklist\Hooks->onEditFilterMergedContent()
#18 /var/www/html/includes/HookContainer/HookRunner.php(1474): MediaWiki\HookContainer\HookContainer->run()
#19 /var/www/html/includes/editpage/Constraint/EditFilterMergedContentHookConstraint.php(106): MediaWiki\HookContainer\HookRunner->onEditFilterMergedContent()
#20 /var/www/html/includes/editpage/Constraint/EditConstraintRunner.php(88): MediaWiki\EditPage\Constraint\EditFilterMergedContentHookConstraint->checkConstraint()
#21 /var/www/html/includes/EditPage.php(2506): MediaWiki\EditPage\Constraint\EditConstraintRunner->checkConstraints()
#22 /var/www/html/includes/EditPage.php(1904): EditPage->internalAttemptSave()
#23 /var/www/html/includes/EditPage.php(721): EditPage->attemptSave()
#24 /var/www/html/includes/actions/EditAction.php(73): EditPage->edit()
#25 /var/www/html/includes/actions/SubmitAction.php(38): EditAction->show()
#26 /var/www/html/includes/MediaWiki.php(542): SubmitAction->show()
#27 /var/www/html/includes/MediaWiki.php(322): MediaWiki->performAction()
#28 /var/www/html/includes/MediaWiki.php(904): MediaWiki->performRequest()
#29 /var/www/html/includes/MediaWiki.php(562): MediaWiki->main()
#30 /var/www/html/index.php(50): MediaWiki->run()
#31 /var/www/html/index.php(46): wfIndexMain()
alex4401 commented 1 year ago

Pushed the fix. If possible, please checkout 8619c5d in your installation. Otherwise, 0.16.11 will include the fix.

daflyinbed commented 1 year ago

@alex4401 Thank You for Your Quick Response! now it becames

[18ccd67dce2639ed9b64b8c2] Error: Using $this when not in object context

Backtrace:

from /var/www/html/extensions/DataMaps/includes/Rendering/ParserFunction_EmbedDataMap.php(19)
#0 /var/www/html/includes/parser/Parser.php(3437): MediaWiki\Extension\DataMaps\Rendering\ParserFunction_EmbedDataMap::run()
#1 /var/www/html/includes/parser/Parser.php(3122): Parser->callParserFunction()
#2 /var/www/html/includes/parser/PPFrame_Hash.php(275): Parser->braceSubstitution()
#3 /var/www/html/includes/parser/Parser.php(2951): PPFrame_Hash->expand()
#4 /var/www/html/includes/parser/Parser.php(1609): Parser->replaceVariables()
#5 /var/www/html/includes/parser/Parser.php(723): Parser->internalParse()
#6 /var/www/html/includes/content/WikitextContentHandler.php(301): Parser->parse()
#7 /var/www/html/includes/content/ContentHandler.php(1721): WikitextContentHandler->fillParserOutput()
#8 /var/www/html/includes/content/Renderer/ContentRenderer.php(47): ContentHandler->getParserOutput()
#9 /var/www/html/includes/Revision/RenderedRevision.php(266): MediaWiki\Content\Renderer\ContentRenderer->getParserOutput()
#10 /var/www/html/includes/Revision/RenderedRevision.php(237): MediaWiki\Revision\RenderedRevision->getSlotParserOutputUncached()
#11 /var/www/html/includes/Revision/RevisionRenderer.php(221): MediaWiki\Revision\RenderedRevision->getSlotParserOutput()
#12 /var/www/html/includes/Revision/RevisionRenderer.php(158): MediaWiki\Revision\RevisionRenderer->combineSlotOutput()
#13 [internal function]: MediaWiki\Revision\RevisionRenderer->MediaWiki\Revision\{closure}()
#14 /var/www/html/includes/Revision/RenderedRevision.php(199): call_user_func()
#15 /var/www/html/includes/poolcounter/PoolWorkArticleView.php(91): MediaWiki\Revision\RenderedRevision->getRevisionParserOutput()
#16 /var/www/html/includes/poolcounter/PoolWorkArticleViewCurrent.php(97): PoolWorkArticleView->renderRevision()
#17 /var/www/html/includes/poolcounter/PoolCounterWork.php(162): PoolWorkArticleViewCurrent->doWork()
#18 /var/www/html/includes/page/ParserOutputAccess.php(299): PoolCounterWork->execute()
#19 /var/www/html/includes/page/Article.php(714): MediaWiki\Page\ParserOutputAccess->getParserOutput()
#20 /var/www/html/includes/page/Article.php(528): Article->generateContentOutput()
#21 /var/www/html/includes/actions/ViewAction.php(78): Article->view()
#22 /var/www/html/includes/MediaWiki.php(542): ViewAction->show()
#23 /var/www/html/includes/MediaWiki.php(322): MediaWiki->performAction()
#24 /var/www/html/includes/MediaWiki.php(904): MediaWiki->performRequest()
#25 /var/www/html/includes/MediaWiki.php(562): MediaWiki->main()
#26 /var/www/html/index.php(50): MediaWiki->run()
#27 /var/www/html/index.php(46): wfIndexMain()
#28 {main}
alex4401 commented 1 year ago

The hel- oh, right. I haven't begun PHP 8 testing yet so there's probably going to be a bunch of oversights like this.

alex4401 commented 1 year ago

Try 53197fc. Reopening until you can confirm.

daflyinbed commented 1 year ago

53197fc works. thank you!