ProfessionalWiki / ModernTimeline

Provides a modern timeline visualization for Semantic MediaWiki as a result format
https://professional.wiki
Other
15 stars 7 forks source link

Error in MW 1.34 when using template #16

Closed krabina closed 4 years ago

krabina commented 4 years ago

Setup

MediaWiki 1.34.1
PHP 7.3.16 (fpm-fcgi)
MySQL 8.0.18
ICU 66.1

MT: 1.1.0 (d3c9652)

Issue

error message is shown in a query that works with format=modertimle when you add template=sometemplate (even an empty one)

Stacktrace

[6d484a0cc6e8c65f5897aa0c] /wiki/index.php?title=Timeline&action=submit TypeError from line 28 of extensions/ModernTimeline/src/SlidePresenter/TemplateSlidePresenter.php: Return value of ModernTimeline\SlidePresenter\TemplateSlidePresenter::getParser() must be an instance of Parser, instance of StubObject returned

Backtrace:

#0 extensions/ModernTimeline/src/SlidePresenter/TemplateSlidePresenter.php(20): ModernTimeline\SlidePresenter\TemplateSlidePresenter->getParser()
#1 extensions/ModernTimeline/src/JsonBuilder.php(76): ModernTimeline\SlidePresenter\TemplateSlidePresenter->getText(ModernTimeline\ResultFacade\Subject)
#2 extensions/ModernTimeline/src/JsonBuilder.php(66): ModernTimeline\JsonBuilder->buildEvent(ModernTimeline\Event)
#3 extensions/ModernTimeline/src/JsonBuilder.php(32): ModernTimeline\JsonBuilder->eventsToTimelineJson(array)
#4 extensions/ModernTimeline/src/TimelinePresenter.php(46): ModernTimeline\JsonBuilder->buildTimelineJson(ModernTimeline\ResultFacade\SubjectCollection)
#5 extensions/ModernTimeline/src/TimelinePresenter.php(38): ModernTimeline\TimelinePresenter->createJsonString(SMW\Query\QueryResult)
#6 extensions/ModernTimeline/src/ModernTimelinePrinter.php(31): ModernTimeline\TimelinePresenter->getResult(SMW\Query\QueryResult)
#7 extensions/SemanticMediaWiki/includes/query/SMW_QueryProcessor.php(348): ModernTimeline\ModernTimelinePrinter->getResult(SMW\Query\QueryResult, array, integer)
#8 extensions/SemanticMediaWiki/src/ParserFunctions/AskParserFunction.php(361): SMWQueryProcessor::getResultFromQuery(SMWQuery, array, integer, integer)
#9 extensions/SemanticMediaWiki/src/ParserFunctions/AskParserFunction.php(196): SMW\ParserFunctions\AskParserFunction->doFetchResultsFromFunctionParameters(array, array)
#10 extensions/SemanticMediaWiki/src/ParserFunctionFactory.php(402): SMW\ParserFunctions\AskParserFunction->parse(array)
#11 includes/parser/Parser.php(3816): SMW\ParserFunctionFactory->SMW\{closure}(Parser, string, string, string, string, string, string, string, string, string, string, string, string, string, string, string, string, string, string, string)
#12 includes/parser/Parser.php(3519): Parser->callParserFunction(PPFrame_Hash, string, array)
#13 includes/parser/PPFrame_Hash.php(254): Parser->braceSubstitution(array, PPFrame_Hash)
#14 includes/parser/Parser.php(3330): PPFrame_Hash->expand(PPNode_Hash_Tree, integer)
#15 includes/parser/Parser.php(1489): Parser->replaceVariables(string)
#16 includes/parser/Parser.php(593): Parser->internalParse(string)
#17 includes/content/WikitextContent.php(368): Parser->parse(string, Title, ParserOptions, boolean, boolean, NULL)
#18 includes/content/AbstractContent.php(555): WikitextContent->fillParserOutput(Title, NULL, ParserOptions, boolean, ParserOutput)
#19 includes/Revision/RenderedRevision.php(264): AbstractContent->getParserOutput(Title, NULL, ParserOptions, boolean)
#20 includes/Revision/RenderedRevision.php(236): MediaWiki\Revision\RenderedRevision->getSlotParserOutputUncached(WikitextContent, boolean)
#21 includes/Revision/RevisionRenderer.php(215): MediaWiki\Revision\RenderedRevision->getSlotParserOutput(string)
#22 includes/Revision/RevisionRenderer.php(152): MediaWiki\Revision\RevisionRenderer->combineSlotOutput(MediaWiki\Revision\RenderedRevision, array)
#23 [internal function]: MediaWiki\Revision\RevisionRenderer->MediaWiki\Revision\{closure}(MediaWiki\Revision\RenderedRevision, array)
#24 includes/Revision/RenderedRevision.php(198): call_user_func(Closure, MediaWiki\Revision\RenderedRevision, array)
#25 includes/Storage/DerivedPageDataUpdater.php(1290): MediaWiki\Revision\RenderedRevision->getRevisionParserOutput()
#26 includes/Storage/PageUpdater.php(725): MediaWiki\Storage\DerivedPageDataUpdater->getCanonicalParserOutput()
#27 includes/page/WikiPage.php(1930): MediaWiki\Storage\PageUpdater->saveRevision(CommentStoreComment, integer)
#28 includes/EditPage.php(2341): WikiPage->doEditContent(WikitextContent, CommentStoreComment, integer, boolean, User, string, array, integer)
#29 includes/EditPage.php(1617): EditPage->internalAttemptSave(array, boolean)
#30 includes/EditPage.php(682): EditPage->attemptSave(array)
#31 includes/actions/EditAction.php(55): EditPage->edit()
#32 includes/actions/SubmitAction.php(38): EditAction->show()
#33 includes/MediaWiki.php(511): SubmitAction->show()
#34 includes/MediaWiki.php(302): MediaWiki->performAction(Article, Title)
#35 includes/MediaWiki.php(900): MediaWiki->performRequest()
#36 includes/MediaWiki.php(527): MediaWiki->main()
#37 index.php(44): MediaWiki->run()
#38 {main}
JeroenDeDauw commented 4 years ago

The good old StubObject errors. We had them 10 years ago, and we still have them today. Yay MediaWiki.

JeroenDeDauw commented 4 years ago

I think this is fixed by https://github.com/ProfessionalWiki/ModernTimeline/commit/9dc7b5c3905e07f5e02aec51b689483edd7d9c31

JeroenDeDauw commented 4 years ago

Yeah definitely got fixed on the CI server. Let me know if some issue remains.

JeroenDeDauw commented 4 years ago

I will release this as part of 1.2.0 soon (later today).

krabina commented 4 years ago

yes, thank you for this super fast response!