Page MenuHomePhabricator

PHP Deprecated: Use of ImageGalleryBase::setHeights without parser was deprecated in MediaWiki 1.43. [Called from MediaWiki\Extension\UploadWizard\CampaignPageFormatter::generateReadHtml]
Closed, ResolvedPublicPRODUCTION ERROR

Description

Error
normalized_message
[{reqId}] {exception_url}   PHP Deprecated: Use of ImageGalleryBase::setHeights without parser was deprecated in MediaWiki 1.43. [Called from MediaWiki\Extension\UploadWizard\CampaignPageFormatter::generateReadHtml]
exception.trace
from /srv/mediawiki/php-1.43.0-wmf.21/extensions/UploadWizard/includes/CampaignPageFormatter.php(59)
#0 [internal function]: MWExceptionHandler::handleError(int, string, string, string, array)
#1 /srv/mediawiki/php-1.43.0-wmf.21/includes/debug/MWDebug.php(385): trigger_error(string, int)
#2 /srv/mediawiki/php-1.43.0-wmf.21/includes/debug/MWDebug.php(356): MediaWiki\Debug\MWDebug::sendRawDeprecated(string, bool, string)
#3 /srv/mediawiki/php-1.43.0-wmf.21/includes/debug/MWDebug.php(237): MediaWiki\Debug\MWDebug::deprecatedMsg(string, string, string, int)
#4 /srv/mediawiki/php-1.43.0-wmf.21/includes/GlobalFunctions.php(780): MediaWiki\Debug\MWDebug::deprecated(string, string, string, int)
#5 /srv/mediawiki/php-1.43.0-wmf.21/includes/gallery/ImageGalleryBase.php(269): wfDeprecated(string, string)
#6 /srv/mediawiki/php-1.43.0-wmf.21/extensions/UploadWizard/includes/CampaignPageFormatter.php(59): ImageGalleryBase->setHeights(string)
#7 /srv/mediawiki/php-1.43.0-wmf.21/extensions/UploadWizard/includes/CampaignContentHandler.php(88): MediaWiki\Extension\UploadWizard\CampaignPageFormatter->generateReadHtml()
#8 /srv/mediawiki/php-1.43.0-wmf.21/extensions/UploadWizard/includes/CampaignContentHandler.php(64): MediaWiki\Extension\UploadWizard\CampaignContentHandler->generateHtml(MediaWiki\Extension\UploadWizard\Campaign)
#9 /srv/mediawiki/php-1.43.0-wmf.21/includes/content/ContentHandler.php(1693): MediaWiki\Extension\UploadWizard\CampaignContentHandler->fillParserOutput(MediaWiki\Extension\UploadWizard\CampaignContent, MediaWiki\Content\Renderer\ContentParseParams, MediaWiki\Parser\ParserOutput)
#10 /srv/mediawiki/php-1.43.0-wmf.21/includes/content/Renderer/ContentRenderer.php(79): MediaWiki\Content\ContentHandler->getParserOutput(MediaWiki\Extension\UploadWizard\CampaignContent, MediaWiki\Content\Renderer\ContentParseParams)
#11 /srv/mediawiki/php-1.43.0-wmf.21/includes/Revision/RenderedRevision.php(262): MediaWiki\Content\Renderer\ContentRenderer->getParserOutput(MediaWiki\Extension\UploadWizard\CampaignContent, MediaWiki\Title\Title, MediaWiki\Revision\RevisionStoreCacheRecord, ParserOptions, array)
#12 /srv/mediawiki/php-1.43.0-wmf.21/includes/Revision/RenderedRevision.php(234): MediaWiki\Revision\RenderedRevision->getSlotParserOutputUncached(MediaWiki\Extension\UploadWizard\CampaignContent, array)
#13 /srv/mediawiki/php-1.43.0-wmf.21/includes/Revision/RevisionRenderer.php(234): MediaWiki\Revision\RenderedRevision->getSlotParserOutput(string, array)
#14 /srv/mediawiki/php-1.43.0-wmf.21/includes/Revision/RevisionRenderer.php(170): MediaWiki\Revision\RevisionRenderer->combineSlotOutput(MediaWiki\Revision\RenderedRevision, ParserOptions, array)
#15 [internal function]: MediaWiki\Revision\RevisionRenderer->MediaWiki\Revision\{closure}(MediaWiki\Revision\RenderedRevision, array)
#16 /srv/mediawiki/php-1.43.0-wmf.21/includes/Revision/RenderedRevision.php(199): call_user_func(Closure, MediaWiki\Revision\RenderedRevision, array)
#17 /srv/mediawiki/php-1.43.0-wmf.21/includes/poolcounter/PoolWorkArticleView.php(97): MediaWiki\Revision\RenderedRevision->getRevisionParserOutput()
#18 /srv/mediawiki/php-1.43.0-wmf.21/includes/poolcounter/PoolWorkArticleView.php(74): MediaWiki\PoolCounter\PoolWorkArticleView->renderRevision()
#19 /srv/mediawiki/php-1.43.0-wmf.21/includes/poolcounter/PoolCounterWork.php(171): MediaWiki\PoolCounter\PoolWorkArticleView->doWork()
#20 /srv/mediawiki/php-1.43.0-wmf.21/includes/page/ParserOutputAccess.php(358): MediaWiki\PoolCounter\PoolCounterWork->execute()
#21 /srv/mediawiki/php-1.43.0-wmf.21/includes/page/Article.php(826): MediaWiki\Page\ParserOutputAccess->getParserOutput(WikiPage, ParserOptions, MediaWiki\Revision\RevisionStoreCacheRecord, int)
#22 /srv/mediawiki/php-1.43.0-wmf.21/includes/page/Article.php(545): Article->generateContentOutput(MediaWiki\User\User, ParserOptions, int, MediaWiki\Output\OutputPage, array)
#23 /srv/mediawiki/php-1.43.0-wmf.21/includes/actions/ViewAction.php(78): Article->view()
#24 /srv/mediawiki/php-1.43.0-wmf.21/includes/actions/ActionEntryPoint.php(731): ViewAction->show()
#25 /srv/mediawiki/php-1.43.0-wmf.21/includes/actions/ActionEntryPoint.php(508): MediaWiki\Actions\ActionEntryPoint->performAction(Article, MediaWiki\Title\Title)
#26 /srv/mediawiki/php-1.43.0-wmf.21/includes/actions/ActionEntryPoint.php(145): MediaWiki\Actions\ActionEntryPoint->performRequest()
#27 /srv/mediawiki/php-1.43.0-wmf.21/includes/MediaWikiEntryPoint.php(200): MediaWiki\Actions\ActionEntryPoint->execute()
#28 /srv/mediawiki/php-1.43.0-wmf.21/index.php(58): MediaWiki\MediaWikiEntryPoint->run()
#29 /srv/mediawiki/w/index.php(3): require(string)
#30 {main}
Notes

Always paired with a similar warning about ImageGalleryBase::setWidths

Event Timeline

Change #1069590 had a related patch set uploaded (by Umherirrender; author: Umherirrender):

[mediawiki/extensions/UploadWizard@master] Set parser for image gallery in CampaignPageFormatter

https://gerrit.wikimedia.org/r/1069590

Change #1069590 merged by jenkins-bot:

[mediawiki/extensions/UploadWizard@master] Set parser for image gallery in CampaignPageFormatter

https://gerrit.wikimedia.org/r/1069590

Umherirrender claimed this task.

Change #1071027 had a related patch set uploaded (by Ahmon Dancy; author: Umherirrender):

[mediawiki/extensions/UploadWizard@wmf/1.43.0-wmf.21] Set parser for image gallery in CampaignPageFormatter

https://gerrit.wikimedia.org/r/1071027

Change #1071027 merged by jenkins-bot:

[mediawiki/extensions/UploadWizard@wmf/1.43.0-wmf.21] Set parser for image gallery in CampaignPageFormatter

https://gerrit.wikimedia.org/r/1071027

Mentioned in SAL (#wikimedia-operations) [2024-09-05T21:00:45Z] <dancy@deploy1003> Started scap sync-world: Backport for [[gerrit:1071027|Set parser for image gallery in CampaignPageFormatter (T374146)]]

Mentioned in SAL (#wikimedia-operations) [2024-09-05T21:02:41Z] <dancy@deploy1003> dancy: Backport for [[gerrit:1071027|Set parser for image gallery in CampaignPageFormatter (T374146)]] synced to the testservers (https://wikitech.wikimedia.org/wiki/Mwdebug)

https://gerrit.wikimedia.org/r/1071027 failed on testservers when accessing https://commons.wikimedia.org/wiki/Campaign:Photographier_le_patrimoine_vivant_en_France_2024:

Error
normalized_message
[{reqId}] {exception_url}   Error: Call to a member function addModules() on null
exception.trace
from /srv/mediawiki/php-1.43.0-wmf.21/includes/gallery/TraditionalImageGallery.php(71)
#0 /srv/mediawiki/php-1.43.0-wmf.21/extensions/UploadWizard/includes/CampaignPageFormatter.php(108): TraditionalImageGallery->toHTML()
#1 /srv/mediawiki/php-1.43.0-wmf.21/extensions/UploadWizard/includes/CampaignContentHandler.php(88): MediaWiki\Extension\UploadWizard\CampaignPageFormatter->generateReadHtml()
#2 /srv/mediawiki/php-1.43.0-wmf.21/extensions/UploadWizard/includes/CampaignContentHandler.php(64): MediaWiki\Extension\UploadWizard\CampaignContentHandler->generateHtml(MediaWiki\Extension\UploadWizard\Campaign)
#3 /srv/mediawiki/php-1.43.0-wmf.21/includes/content/ContentHandler.php(1693): MediaWiki\Extension\UploadWizard\CampaignContentHandler->fillParserOutput(MediaWiki\Extension\UploadWizard\CampaignContent, MediaWiki\Content\Renderer\ContentParseParams, MediaWiki\Parser\ParserOutput)
#4 /srv/mediawiki/php-1.43.0-wmf.21/includes/content/Renderer/ContentRenderer.php(79): MediaWiki\Content\ContentHandler->getParserOutput(MediaWiki\Extension\UploadWizard\CampaignContent, MediaWiki\Content\Renderer\ContentParseParams)
#5 /srv/mediawiki/php-1.43.0-wmf.21/includes/Revision/RenderedRevision.php(262): MediaWiki\Content\Renderer\ContentRenderer->getParserOutput(MediaWiki\Extension\UploadWizard\CampaignContent, MediaWiki\Title\Title, MediaWiki\Revision\RevisionStoreCacheRecord, ParserOptions, array)
#6 /srv/mediawiki/php-1.43.0-wmf.21/includes/Revision/RenderedRevision.php(234): MediaWiki\Revision\RenderedRevision->getSlotParserOutputUncached(MediaWiki\Extension\UploadWizard\CampaignContent, array)
#7 /srv/mediawiki/php-1.43.0-wmf.21/includes/Revision/RevisionRenderer.php(234): MediaWiki\Revision\RenderedRevision->getSlotParserOutput(string, array)
#8 /srv/mediawiki/php-1.43.0-wmf.21/includes/Revision/RevisionRenderer.php(170): MediaWiki\Revision\RevisionRenderer->combineSlotOutput(MediaWiki\Revision\RenderedRevision, ParserOptions, array)
#9 [internal function]: MediaWiki\Revision\RevisionRenderer->MediaWiki\Revision\{closure}(MediaWiki\Revision\RenderedRevision, array)
#10 /srv/mediawiki/php-1.43.0-wmf.21/includes/Revision/RenderedRevision.php(199): call_user_func(Closure, MediaWiki\Revision\RenderedRevision, array)
#11 /srv/mediawiki/php-1.43.0-wmf.21/includes/poolcounter/PoolWorkArticleView.php(97): MediaWiki\Revision\RenderedRevision->getRevisionParserOutput()
#12 /srv/mediawiki/php-1.43.0-wmf.21/includes/poolcounter/PoolWorkArticleView.php(74): MediaWiki\PoolCounter\PoolWorkArticleView->renderRevision()
#13 /srv/mediawiki/php-1.43.0-wmf.21/includes/poolcounter/PoolCounterWork.php(171): MediaWiki\PoolCounter\PoolWorkArticleView->doWork()
#14 /srv/mediawiki/php-1.43.0-wmf.21/includes/page/ParserOutputAccess.php(358): MediaWiki\PoolCounter\PoolCounterWork->execute()
#15 /srv/mediawiki/php-1.43.0-wmf.21/includes/page/Article.php(826): MediaWiki\Page\ParserOutputAccess->getParserOutput(WikiPage, ParserOptions, MediaWiki\Revision\RevisionStoreCacheRecord, int)
#16 /srv/mediawiki/php-1.43.0-wmf.21/includes/page/Article.php(545): Article->generateContentOutput(MediaWiki\User\User, ParserOptions, int, MediaWiki\Output\OutputPage, array)
#17 /srv/mediawiki/php-1.43.0-wmf.21/includes/actions/ViewAction.php(78): Article->view()
#18 /srv/mediawiki/php-1.43.0-wmf.21/includes/actions/ActionEntryPoint.php(731): ViewAction->show()
#19 /srv/mediawiki/php-1.43.0-wmf.21/includes/actions/ActionEntryPoint.php(508): MediaWiki\Actions\ActionEntryPoint->performAction(Article, MediaWiki\Title\Title)
#20 /srv/mediawiki/php-1.43.0-wmf.21/includes/actions/ActionEntryPoint.php(145): MediaWiki\Actions\ActionEntryPoint->performRequest()
#21 /srv/mediawiki/php-1.43.0-wmf.21/includes/MediaWikiEntryPoint.php(200): MediaWiki\Actions\ActionEntryPoint->execute()
#22 /srv/mediawiki/php-1.43.0-wmf.21/index.php(58): MediaWiki\MediaWikiEntryPoint->run()
#23 /srv/mediawiki/w/index.php(3): require(string)
#24 {main}

I'm reverting the change for wmf/1.43.0-wmf.21.

dancy triaged this task as Medium priority.

Change #1071263 had a related patch set uploaded (by Umherirrender; author: Umherirrender):

[mediawiki/extensions/UploadWizard@master] Use default width/height on gallery to avoid parser instance

https://gerrit.wikimedia.org/r/1071263

https://gerrit.wikimedia.org/r/1071027 failed on testservers when accessing https://commons.wikimedia.org/wiki/Campaign:Photographier_le_patrimoine_vivant_en_France_2024:

Error
normalized_message
[{reqId}] {exception_url}   Error: Call to a member function addModules() on null
exception.trace
from /srv/mediawiki/php-1.43.0-wmf.21/includes/gallery/TraditionalImageGallery.php(71)
#0 /srv/mediawiki/php-1.43.0-wmf.21/extensions/UploadWizard/includes/CampaignPageFormatter.php(108): TraditionalImageGallery->toHTML()
#1 /srv/mediawiki/php-1.43.0-wmf.21/extensions/UploadWizard/includes/CampaignContentHandler.php(88): MediaWiki\Extension\UploadWizard\CampaignPageFormatter->generateReadHtml()
#2 /srv/mediawiki/php-1.43.0-wmf.21/extensions/UploadWizard/includes/CampaignContentHandler.php(64): MediaWiki\Extension\UploadWizard\CampaignContentHandler->generateHtml(MediaWiki\Extension\UploadWizard\Campaign)
#3 /srv/mediawiki/php-1.43.0-wmf.21/includes/content/ContentHandler.php(1693): MediaWiki\Extension\UploadWizard\CampaignContentHandler->fillParserOutput(MediaWiki\Extension\UploadWizard\CampaignContent, MediaWiki\Content\Renderer\ContentParseParams, MediaWiki\Parser\ParserOutput)
#4 /srv/mediawiki/php-1.43.0-wmf.21/includes/content/Renderer/ContentRenderer.php(79): MediaWiki\Content\ContentHandler->getParserOutput(MediaWiki\Extension\UploadWizard\CampaignContent, MediaWiki\Content\Renderer\ContentParseParams)
#5 /srv/mediawiki/php-1.43.0-wmf.21/includes/Revision/RenderedRevision.php(262): MediaWiki\Content\Renderer\ContentRenderer->getParserOutput(MediaWiki\Extension\UploadWizard\CampaignContent, MediaWiki\Title\Title, MediaWiki\Revision\RevisionStoreCacheRecord, ParserOptions, array)
#6 /srv/mediawiki/php-1.43.0-wmf.21/includes/Revision/RenderedRevision.php(234): MediaWiki\Revision\RenderedRevision->getSlotParserOutputUncached(MediaWiki\Extension\UploadWizard\CampaignContent, array)
#7 /srv/mediawiki/php-1.43.0-wmf.21/includes/Revision/RevisionRenderer.php(234): MediaWiki\Revision\RenderedRevision->getSlotParserOutput(string, array)
#8 /srv/mediawiki/php-1.43.0-wmf.21/includes/Revision/RevisionRenderer.php(170): MediaWiki\Revision\RevisionRenderer->combineSlotOutput(MediaWiki\Revision\RenderedRevision, ParserOptions, array)
#9 [internal function]: MediaWiki\Revision\RevisionRenderer->MediaWiki\Revision\{closure}(MediaWiki\Revision\RenderedRevision, array)
#10 /srv/mediawiki/php-1.43.0-wmf.21/includes/Revision/RenderedRevision.php(199): call_user_func(Closure, MediaWiki\Revision\RenderedRevision, array)
#11 /srv/mediawiki/php-1.43.0-wmf.21/includes/poolcounter/PoolWorkArticleView.php(97): MediaWiki\Revision\RenderedRevision->getRevisionParserOutput()
#12 /srv/mediawiki/php-1.43.0-wmf.21/includes/poolcounter/PoolWorkArticleView.php(74): MediaWiki\PoolCounter\PoolWorkArticleView->renderRevision()
#13 /srv/mediawiki/php-1.43.0-wmf.21/includes/poolcounter/PoolCounterWork.php(171): MediaWiki\PoolCounter\PoolWorkArticleView->doWork()
#14 /srv/mediawiki/php-1.43.0-wmf.21/includes/page/ParserOutputAccess.php(358): MediaWiki\PoolCounter\PoolCounterWork->execute()
#15 /srv/mediawiki/php-1.43.0-wmf.21/includes/page/Article.php(826): MediaWiki\Page\ParserOutputAccess->getParserOutput(WikiPage, ParserOptions, MediaWiki\Revision\RevisionStoreCacheRecord, int)
#16 /srv/mediawiki/php-1.43.0-wmf.21/includes/page/Article.php(545): Article->generateContentOutput(MediaWiki\User\User, ParserOptions, int, MediaWiki\Output\OutputPage, array)
#17 /srv/mediawiki/php-1.43.0-wmf.21/includes/actions/ViewAction.php(78): Article->view()
#18 /srv/mediawiki/php-1.43.0-wmf.21/includes/actions/ActionEntryPoint.php(731): ViewAction->show()
#19 /srv/mediawiki/php-1.43.0-wmf.21/includes/actions/ActionEntryPoint.php(508): MediaWiki\Actions\ActionEntryPoint->performAction(Article, MediaWiki\Title\Title)
#20 /srv/mediawiki/php-1.43.0-wmf.21/includes/actions/ActionEntryPoint.php(145): MediaWiki\Actions\ActionEntryPoint->performRequest()
#21 /srv/mediawiki/php-1.43.0-wmf.21/includes/MediaWikiEntryPoint.php(200): MediaWiki\Actions\ActionEntryPoint->execute()
#22 /srv/mediawiki/php-1.43.0-wmf.21/index.php(58): MediaWiki\MediaWikiEntryPoint->run()
#23 /srv/mediawiki/w/index.php(3): require(string)
#24 {main}

I'm reverting the change for wmf/1.43.0-wmf.21.

There is no ParserOutput on the parser instance I have used to avoid the deprecation notice. I have no idea how to get a parser instance here, which is usable. Removed the width/height feature instead.
Not sure what the original refactor in 0450b5e4d58387a0d57dc699c2c58f8e780ca44e is trying to fix in case of gallery (and for a hardcoded value).

Change #1071263 merged by jenkins-bot:

[mediawiki/extensions/UploadWizard@master] Use default width/height on gallery to avoid parser instance

https://gerrit.wikimedia.org/r/1071263

Change #1071265 had a related patch set uploaded (by Jforrester; author: Umherirrender):

[mediawiki/extensions/UploadWizard@wmf/1.43.0-wmf.21] Use default width/height on gallery to avoid parser instance

https://gerrit.wikimedia.org/r/1071265

Change #1071265 merged by jenkins-bot:

[mediawiki/extensions/UploadWizard@wmf/1.43.0-wmf.21] Use default width/height on gallery to avoid parser instance

https://gerrit.wikimedia.org/r/1071265

Mentioned in SAL (#wikimedia-operations) [2024-09-09T13:36:54Z] <jforrester@deploy1003> Started scap sync-world: Backport for [[gerrit:1071251|Define wgCheckUserCentralIndexRangesToExclude to exclude WMCS (T373021)]], [[gerrit:rEWBA1071253a7fd3|tests: Disable all Beta Cluster CI testing, all failing (T374242)]], [[gerrit:1071254|Don't pass empty type/returnType to zobject lookup when undefined (T374199)]], [[gerrit:1071265|Use default width/height on gallery to avoid parser instance (T374146

Mentioned in SAL (#wikimedia-operations) [2024-09-09T13:40:26Z] <jforrester@deploy1003> dreamyjazz, jforrester: Backport for [[gerrit:1071251|Define wgCheckUserCentralIndexRangesToExclude to exclude WMCS (T373021)]], [[gerrit:rEWBA1071253a7fd3|tests: Disable all Beta Cluster CI testing, all failing (T374242)]], [[gerrit:1071254|Don't pass empty type/returnType to zobject lookup when undefined (T374199)]], [[gerrit:1071265|Use default width/height on gallery to avoid parser instance (T374146)

Mentioned in SAL (#wikimedia-operations) [2024-09-09T13:46:31Z] <jforrester@deploy1003> Started scap sync-world: Backport for [[gerrit:1071251|Define wgCheckUserCentralIndexRangesToExclude to exclude WMCS (T373021)]], [[gerrit:rEWBA1071253a7fd3|tests: Disable all Beta Cluster CI testing, all failing (T374242)]], [[gerrit:1071254|Don't pass empty type/returnType to zobject lookup when undefined (T374199)]], [[gerrit:1071265|Use default width/height on gallery to avoid parser instance (T374146

Mentioned in SAL (#wikimedia-operations) [2024-09-09T13:50:31Z] <jforrester@deploy1003> dreamyjazz, jforrester: Backport for [[gerrit:1071251|Define wgCheckUserCentralIndexRangesToExclude to exclude WMCS (T373021)]], [[gerrit:rEWBA1071253a7fd3|tests: Disable all Beta Cluster CI testing, all failing (T374242)]], [[gerrit:1071254|Don't pass empty type/returnType to zobject lookup when undefined (T374199)]], [[gerrit:1071265|Use default width/height on gallery to avoid parser instance (T374146)

Jdforrester-WMF subscribed.

Deployed; this should now be resolved.