Page MenuHomePhabricator

PHP Deprecated: Use of MediaWiki\Content\Renderer\ContentRenderer::getParserOutput with integer revision id
Closed, ResolvedPublicPRODUCTION ERROR

Description

Error
labels.normalized_message
[{reqId}] {exception_url}   PHP Deprecated: Use of MediaWiki\Content\Renderer\ContentRenderer::getParserOutput with integer revision id was deprecated in MediaWiki 1.42. [Called from MediaWiki\Extension\TemplateSandbox\SpecialTemplateSandbox::onSubmit]
error.stack_trace
from /srv/mediawiki/php-1.42.0-wmf.18/extensions/TemplateSandbox/includes/SpecialTemplateSandbox.php(274)
#0 [internal function]: MWExceptionHandler::handleError(integer, string, string, string, array)
#1 /srv/mediawiki/php-1.42.0-wmf.18/includes/debug/MWDebug.php(379): trigger_error(string, integer)
#2 /srv/mediawiki/php-1.42.0-wmf.18/includes/debug/MWDebug.php(350): MWDebug::sendRawDeprecated(string, boolean, string)
#3 /srv/mediawiki/php-1.42.0-wmf.18/includes/debug/MWDebug.php(231): MWDebug::deprecatedMsg(string, string, string, integer)
#4 /srv/mediawiki/php-1.42.0-wmf.18/includes/GlobalFunctions.php(773): MWDebug::deprecated(string, string, string, integer)
#5 /srv/mediawiki/php-1.42.0-wmf.18/includes/content/Renderer/ContentRenderer.php(57): wfDeprecated(string, string)
#6 /srv/mediawiki/php-1.42.0-wmf.18/extensions/TemplateSandbox/includes/SpecialTemplateSandbox.php(274): MediaWiki\Content\Renderer\ContentRenderer->getParserOutput(WikitextContent, MediaWiki\Title\Title, integer, ParserOptions)
#7 /srv/mediawiki/php-1.42.0-wmf.18/includes/htmlform/HTMLForm.php(748): MediaWiki\Extension\TemplateSandbox\SpecialTemplateSandbox->onSubmit(array, OOUIHTMLForm)
#8 /srv/mediawiki/php-1.42.0-wmf.18/includes/htmlform/HTMLForm.php(629): HTMLForm->trySubmit()
#9 /srv/mediawiki/php-1.42.0-wmf.18/extensions/TemplateSandbox/includes/SpecialTemplateSandbox.php(116): HTMLForm->tryAuthorizedSubmit()
#10 /srv/mediawiki/php-1.42.0-wmf.18/includes/specialpage/SpecialPage.php(720): MediaWiki\Extension\TemplateSandbox\SpecialTemplateSandbox->execute(NULL)
#11 /srv/mediawiki/php-1.42.0-wmf.18/includes/specialpage/SpecialPageFactory.php(1653): MediaWiki\SpecialPage\SpecialPage->run(NULL)
#12 /srv/mediawiki/php-1.42.0-wmf.18/includes/actions/ActionEntryPoint.php(504): MediaWiki\SpecialPage\SpecialPageFactory->executePath(string, MediaWiki\Context\RequestContext)
#13 /srv/mediawiki/php-1.42.0-wmf.18/includes/actions/ActionEntryPoint.php(145): MediaWiki\Actions\ActionEntryPoint->performRequest()
#14 /srv/mediawiki/php-1.42.0-wmf.18/includes/MediaWikiEntryPoint.php(199): MediaWiki\Actions\ActionEntryPoint->execute()
#15 /srv/mediawiki/php-1.42.0-wmf.18/index.php(58): MediaWiki\MediaWikiEntryPoint->run()
#16 /srv/mediawiki/w/index.php(3): require(string)
#17 {main}
Impact

Hard deprecation in production is against the deprecation policy. Fixing callers or reverting hard-deprecation blocks the next train.

Notes

There are calls from more than one caller so I've not filed seperate tasks. At least these were found. If the decision is to fix callers, and if doing so is non-trivial, you'll probably want to file separate tasks for each.

PHP Deprecated: Use of MediaWiki\Content\Renderer\ContentRenderer::getParserOutput with integer revision id was deprecated in MediaWiki 1.42. [Called from MediaWiki\Extension\TemplateSandbox\Hooks::onAlternateEditPreview]`
PHP Deprecated: Use of MediaWiki\Content\Renderer\ContentRenderer::getParserOutput with integer revision id was deprecated in MediaWiki 1.42. [Called from FRInclusionCache::{closure}]
PHP Deprecated: Use of MediaWiki\Content\Renderer\ContentRenderer::getParserOutput with integer revision id was deprecated in MediaWiki 1.42. [Called from MediaWiki\Extension\TemplateSandbox\SpecialTemplateSandbox::onSubmit]

Event Timeline

Example fix from FlaggedRevs https://gerrit.wikimedia.org/r/c/mediawiki/extensions/FlaggedRevs/+/998942

That comes from 7fa728d6eca6fb4504ef6b46ba7cded1d5d71f81 Do not hard deprecate passing an int to ContentRenderer::getParserOutput for T357006

Krinkle added subscribers: cscott, taavi.

From https://gerrit.wikimedia.org/r/c/mediawiki/core/+/998968:

Revert "Do not hard deprecate passing an int to ContentRenderer::getParserOutput"

Reason for revert: The remaining use in FlaggedRevs has been fixed.

@cscott Looks like FR as well as TemplateStyles are both still using this. Please take a look :)

As far as I can tell it ought to be. FlaggedRevs and TemplateSandbox were the two extensions affected.

These notices should be gone as of the deployment of 1.42.0-wmf.19 last week and this task should probably be closed. I just checked the original logstash URL and couldn't find any instances after wmf.18 on Feb 22.

cscott assigned this task to Umherirrender.

Change 1007418 had a related patch set uploaded (by C. Scott Ananian; author: C. Scott Ananian):

[mediawiki/core@master] Tighten up phan type for ContentRenderer::getParserOutput()

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

Change 1007418 merged by jenkins-bot:

[mediawiki/core@master] Tighten up phan type for ContentRenderer::getParserOutput()

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