Page MenuHomePhabricator

Widgets Extension - $wgWidgetsUseFlaggedRevs broken
Closed, ResolvedPublic

Description

Steps to replicate the issue (include links if applicable):

Use as instructed by the documentation.
https://www.mediawiki.org/wiki/Extension:Widgets

Except for a small modification required for reasons explained in T313363.

wfLoadExtension( 'Widgets' );
wfLoadExtension( 'FlaggedRevs' );
$wgFlaggedRevsNamespaces = [
    272
];
$wgFlaggedRevTags = [
    'security' => [
        'levels' => 1,
        'quality' => 1,
        'pristine' => 1
    ]
];
$wgFlaggedRevsOverride = true;
$wgWidgetsUseFlaggedRevs = true;

What happens?:

MediaWiki internal error.

Original exception: [12aed1bd6fda51bdd8338f86] /wiki/FAQ Error: Class 'FlaggedArticle' not found
Backtrace:
from /var/www/w/extensions/Widgets/WidgetRenderer.php(188)
#0 [internal function]: WidgetRenderer::wiki_get_template()
#1 /var/www/w/extensions/Widgets/vendor/smarty/smarty/libs/sysplugins/smarty_internal_resource_registered.php(82): call_user_func_array()
#2 /var/www/w/extensions/Widgets/vendor/smarty/smarty/libs/sysplugins/smarty_template_source.php(211): Smarty_Internal_Resource_Registered->getContent()
#3 /var/www/w/extensions/Widgets/vendor/smarty/smarty/libs/sysplugins/smarty_internal_templatecompilerbase.php(479): Smarty_Template_Source->getContent()
#4 /var/www/w/extensions/Widgets/vendor/smarty/smarty/libs/sysplugins/smarty_internal_templatecompilerbase.php(402): Smarty_Internal_TemplateCompilerBase->compileTemplateSource()
#5 /var/www/w/extensions/Widgets/vendor/smarty/smarty/libs/sysplugins/smarty_template_compiled.php(184): Smarty_Internal_TemplateCompilerBase->compileTemplate()
#6 /var/www/w/extensions/Widgets/vendor/smarty/smarty/libs/sysplugins/smarty_template_compiled.php(141): Smarty_Template_Compiled->compileTemplateSource()
#7 /var/www/w/extensions/Widgets/vendor/smarty/smarty/libs/sysplugins/smarty_template_compiled.php(105): Smarty_Template_Compiled->process()
#8 /var/www/w/extensions/Widgets/vendor/smarty/smarty/libs/sysplugins/smarty_internal_template.php(216): Smarty_Template_Compiled->render()
#9 /var/www/w/extensions/Widgets/vendor/smarty/smarty/libs/sysplugins/smarty_internal_templatebase.php(232): Smarty_Internal_Template->render()
#10 /var/www/w/extensions/Widgets/vendor/smarty/smarty/libs/sysplugins/smarty_internal_templatebase.php(116): Smarty_Internal_TemplateBase->_execute()
#11 /var/www/w/extensions/Widgets/WidgetRenderer.php(131): Smarty_Internal_TemplateBase->fetch()
#12 /var/www/w/includes/parser/Parser.php(3413): WidgetRenderer::renderWidget()
#13 /var/www/w/includes/parser/Parser.php(3096): Parser->callParserFunction()
#14 /var/www/w/includes/parser/PPFrame_Hash.php(276): Parser->braceSubstitution()
#15 /var/www/w/includes/parser/PPTemplateFrame_Hash.php(97): PPFrame_Hash->expand()
#16 /var/www/w/includes/parser/Parser.php(3284): PPTemplateFrame_Hash->cachedExpand()
#17 /var/www/w/includes/parser/PPFrame_Hash.php(276): Parser->braceSubstitution()
#18 /var/www/w/includes/parser/Parser.php(2932): PPFrame_Hash->expand()
#19 /var/www/w/includes/parser/Parser.php(1579): Parser->replaceVariables()
#20 /var/www/w/includes/parser/Parser.php(697): Parser->internalParse()
#21 /var/www/w/includes/content/WikitextContentHandler.php(294): Parser->parse()
#22 /var/www/w/includes/content/ContentHandler.php(1705): WikitextContentHandler->fillParserOutput()
#23 /var/www/w/includes/content/Renderer/ContentRenderer.php(47): ContentHandler->getParserOutput()
#24 /var/www/w/includes/Revision/RenderedRevision.php(267): MediaWiki\Content\Renderer\ContentRenderer->getParserOutput()
#25 /var/www/w/includes/Revision/RenderedRevision.php(238): MediaWiki\Revision\RenderedRevision->getSlotParserOutputUncached()
#26 /var/www/w/includes/Revision/RevisionRenderer.php(221): MediaWiki\Revision\RenderedRevision->getSlotParserOutput()
#27 /var/www/w/includes/Revision/RevisionRenderer.php(158): MediaWiki\Revision\RevisionRenderer->combineSlotOutput()
#28 [internal function]: MediaWiki\Revision\RevisionRenderer->MediaWiki\Revision\{closure}()
#29 /var/www/w/includes/Revision/RenderedRevision.php(200): call_user_func()
#30 /var/www/w/includes/poolcounter/PoolWorkArticleView.php(137): MediaWiki\Revision\RenderedRevision->getRevisionParserOutput()
#31 /var/www/w/includes/poolcounter/PoolCounterWork.php(162): PoolWorkArticleView->doWork()
#32 /var/www/w/includes/page/ParserOutputAccess.php(302): PoolCounterWork->execute()
#33 /var/www/w/includes/page/Article.php(702): MediaWiki\Page\ParserOutputAccess->getParserOutput()
#34 /var/www/w/includes/page/Article.php(517): Article->generateContentOutput()
#35 /var/www/w/includes/actions/ViewAction.php(80): Article->view()
#36 /var/www/w/includes/MediaWiki.php(543): ViewAction->show()
#37 /var/www/w/includes/MediaWiki.php(321): MediaWiki->performAction()
#38 /var/www/w/includes/MediaWiki.php(912): MediaWiki->performRequest()
#39 /var/www/w/includes/MediaWiki.php(563): MediaWiki->main()
#40 /var/www/w/index.php(53): MediaWiki->run()
#41 /var/www/w/index.php(46): wfIndexMain()
#42 {main}

Exception caught inside exception handler: [12aed1bd6fda51bdd8338f86] /wiki/FAQ Error: Class 'FlaggedArticle' not found
Backtrace:
from /var/www/w/extensions/Widgets/WidgetRenderer.php(188)
#0 [internal function]: WidgetRenderer::wiki_get_template()
#1 /var/www/w/extensions/Widgets/vendor/smarty/smarty/libs/sysplugins/smarty_internal_resource_registered.php(82): call_user_func_array()
#2 /var/www/w/extensions/Widgets/vendor/smarty/smarty/libs/sysplugins/smarty_template_source.php(211): Smarty_Internal_Resource_Registered->getContent()
#3 /var/www/w/extensions/Widgets/vendor/smarty/smarty/libs/sysplugins/smarty_internal_templatecompilerbase.php(479): Smarty_Template_Source->getContent()
#4 /var/www/w/extensions/Widgets/vendor/smarty/smarty/libs/sysplugins/smarty_internal_templatecompilerbase.php(402): Smarty_Internal_TemplateCompilerBase->compileTemplateSource()
#5 /var/www/w/extensions/Widgets/vendor/smarty/smarty/libs/sysplugins/smarty_template_compiled.php(184): Smarty_Internal_TemplateCompilerBase->compileTemplate()
#6 /var/www/w/extensions/Widgets/vendor/smarty/smarty/libs/sysplugins/smarty_template_compiled.php(141): Smarty_Template_Compiled->compileTemplateSource()
#7 /var/www/w/extensions/Widgets/vendor/smarty/smarty/libs/sysplugins/smarty_template_compiled.php(105): Smarty_Template_Compiled->process()
#8 /var/www/w/extensions/Widgets/vendor/smarty/smarty/libs/sysplugins/smarty_internal_template.php(216): Smarty_Template_Compiled->render()
#9 /var/www/w/extensions/Widgets/vendor/smarty/smarty/libs/sysplugins/smarty_internal_templatebase.php(232): Smarty_Internal_Template->render()
#10 /var/www/w/extensions/Widgets/vendor/smarty/smarty/libs/sysplugins/smarty_internal_templatebase.php(116): Smarty_Internal_TemplateBase->_execute()
#11 /var/www/w/extensions/Widgets/WidgetRenderer.php(131): Smarty_Internal_TemplateBase->fetch()
#12 /var/www/w/includes/parser/Parser.php(3413): WidgetRenderer::renderWidget()
#13 /var/www/w/includes/parser/Parser.php(3096): Parser->callParserFunction()
#14 /var/www/w/includes/parser/PPFrame_Hash.php(276): Parser->braceSubstitution()
#15 /var/www/w/includes/parser/Parser.php(2932): PPFrame_Hash->expand()
#16 /var/www/w/includes/parser/Parser.php(1579): Parser->replaceVariables()
#17 /var/www/w/includes/parser/Parser.php(697): Parser->internalParse()
#18 /var/www/w/includes/OutputPage.php(2261): Parser->parse()
#19 /var/www/w/includes/OutputPage.php(2211): OutputPage->parseInternal()
#20 /var/www/w/includes/skins/Skin.php(1849): OutputPage->parseAsInterface()
#21 /var/www/w/includes/libs/objectcache/wancache/WANObjectCache.php(1685): Skin->{closure}()
#22 /var/www/w/includes/libs/objectcache/wancache/WANObjectCache.php(1518): WANObjectCache->fetchOrRegenerate()
#23 /var/www/w/includes/skins/Skin.php(1850): WANObjectCache->getWithSetCallback()
#24 /var/www/w/includes/skins/Skin.php(1873): Skin->getCachedNotice()
#25 /var/www/w/includes/skins/SkinMustache.php(85): Skin->getSiteNotice()
#26 /var/www/w/skins/Vector/includes/SkinVector.php(564): SkinMustache->getTemplateData()
#27 /var/www/w/includes/skins/SkinMustache.php(58): Vector\SkinVector->getTemplateData()
#28 /var/www/w/skins/Vector/includes/SkinVector.php(455): SkinMustache->generateHTML()
#29 /var/www/w/includes/skins/SkinTemplate.php(150): Vector\SkinVector->generateHTML()
#30 /var/www/w/includes/OutputPage.php(2807): SkinTemplate->outputPage()
#31 /var/www/w/includes/exception/MWExceptionRenderer.php(157): OutputPage->output()
#32 /var/www/w/includes/exception/MWExceptionRenderer.php(76): MWExceptionRenderer::reportHTML()
#33 /var/www/w/includes/exception/MWExceptionHandler.php(107): MWExceptionRenderer::output()
#34 /var/www/w/includes/exception/MWExceptionHandler.php(202): MWExceptionHandler::report()
#35 /var/www/w/includes/MediaWiki.php(585): MWExceptionHandler::handleException()
#36 /var/www/w/index.php(53): MediaWiki->run()
#37 /var/www/w/index.php(46): wfIndexMain()
#38 {main}

What should have happened instead?:

No error.

Software version (skip for WMF-hosted wikis like Wikipedia):

1.38.2

Other information (browser name/version, screenshots, etc.):

Event Timeline

@adrelanos - sorry for the long delay on this. The default ID for the NS_WIDGET namespace is 274, not 272. Could that be the cause of the problem you were seeing? (I haven't tried this myself, since I don't have FlaggedRevs installed.)

adrelanos claimed this task.

Than you! The issue has been fixed.