Universal-Omega / DynamicPageList3

GNU General Public License v3.0
18 stars 21 forks source link

After 1.42, Error: Call to undefined method MediaWiki\Parser\ParserOutput::getCategories() #277

Open lakejason0 opened 2 weeks ago

lakejason0 commented 2 weeks ago

DynamicPageList3 version: 3.5.3 MediaWiki version: 1.42 PHP version: 8.1.28

List of steps to reproduce (step by step, including full links if applicable):

What happens?:

[af122224a4fe400f199a179c] /wiki/%E5%AD%98%E6%A1%A3%E8%AE%A1%E5%88%92:%E6%B2%99%E7%9B%92 Error: Call to undefined method MediaWiki\Parser\ParserOutput::getCategories()

Backtrace:

from /www/wwwroot/podcast/extensions/DynamicPageList3/includes/Hooks.php(559)
#0 /www/wwwroot/podcast/includes/HookContainer/HookContainer.php(159): MediaWiki\Extension\DynamicPageList3\Hooks::endReset()
#1 /www/wwwroot/podcast/includes/HookContainer/HookRunner.php(2907): MediaWiki\HookContainer\HookContainer->run()
#2 /www/wwwroot/podcast/includes/parser/Parser.php(1760): MediaWiki\HookContainer\HookRunner->onParserAfterTidy()
#3 /www/wwwroot/podcast/includes/parser/Parser.php(725): MediaWiki\Parser\Parser->internalParseHalfParsed()
#4 /www/wwwroot/podcast/includes/content/WikitextContentHandler.php(376): MediaWiki\Parser\Parser->parse()
#5 /www/wwwroot/podcast/includes/content/ContentHandler.php(1664): WikitextContentHandler->fillParserOutput()
#6 /www/wwwroot/podcast/includes/content/Renderer/ContentRenderer.php(67): ContentHandler->getParserOutput()
#7 /www/wwwroot/podcast/includes/Revision/RenderedRevision.php(260): MediaWiki\Content\Renderer\ContentRenderer->getParserOutput()
#8 /www/wwwroot/podcast/includes/Revision/RenderedRevision.php(232): MediaWiki\Revision\RenderedRevision->getSlotParserOutputUncached()
#9 /www/wwwroot/podcast/includes/Revision/RevisionRenderer.php(226): MediaWiki\Revision\RenderedRevision->getSlotParserOutput()
#10 /www/wwwroot/podcast/includes/Revision/RevisionRenderer.php(164): MediaWiki\Revision\RevisionRenderer->combineSlotOutput()
#11 [internal function]: MediaWiki\Revision\RevisionRenderer->MediaWiki\Revision\{closure}()
#12 /www/wwwroot/podcast/includes/Revision/RenderedRevision.php(199): call_user_func()
#13 /www/wwwroot/podcast/includes/poolcounter/PoolWorkArticleView.php(91): MediaWiki\Revision\RenderedRevision->getRevisionParserOutput()
#14 /www/wwwroot/podcast/includes/poolcounter/PoolWorkArticleViewCurrent.php(107): MediaWiki\PoolCounter\PoolWorkArticleView->renderRevision()
#15 /www/wwwroot/podcast/includes/poolcounter/PoolCounterWork.php(171): MediaWiki\PoolCounter\PoolWorkArticleViewCurrent->doWork()
#16 /www/wwwroot/podcast/includes/page/ParserOutputAccess.php(328): MediaWiki\PoolCounter\PoolCounterWork->execute()
#17 /www/wwwroot/podcast/includes/page/Article.php(761): MediaWiki\Page\ParserOutputAccess->getParserOutput()
#18 /www/wwwroot/podcast/includes/page/Article.php(563): Article->generateContentOutput()
#19 /www/wwwroot/podcast/includes/actions/ViewAction.php(78): Article->view()
#20 /www/wwwroot/podcast/includes/actions/ActionEntryPoint.php(733): ViewAction->show()
#21 /www/wwwroot/podcast/includes/actions/ActionEntryPoint.php(510): MediaWiki\Actions\ActionEntryPoint->performAction()
#22 /www/wwwroot/podcast/includes/actions/ActionEntryPoint.php(145): MediaWiki\Actions\ActionEntryPoint->performRequest()
#23 /www/wwwroot/podcast/includes/MediaWikiEntryPoint.php(199): MediaWiki\Actions\ActionEntryPoint->execute()
#24 /www/wwwroot/podcast/index.php(58): MediaWiki\MediaWikiEntryPoint->run()
#25 {main}

What should have happened instead?: It runs normally

Browser information, screenshots and other applicable information:

lakejason0 commented 2 weeks ago

According to RELEASE-NOTES-1.42, ::getCategories() is removed and we should use ::getCategoryNames() and ::getCategorySortKey() instead. I replaced these to the former and it works?

AlPha5130 commented 2 weeks ago

In https://gerrit.wikimedia.org/r/plugins/gitiles/mediawiki/core/+/REL1_42/RELEASE-NOTES-1.42 :

  • ParserOutput::getCategories(), deprecated in 1.40, has been removed. You should use ::getCategoryNames() and ::getCategorySortKey() instead.