Page MenuHomePhabricator

PHP Warning: Only arrays and Traversables can be unpacked
Closed, ResolvedPublicPRODUCTION ERROR

Description

Error
labels.normalized_message
[{reqId}] {exception_url}   PHP Warning: Only arrays and Traversables can be unpacked
FrameLocationCall
from/srv/mediawiki/php-1.44.0-wmf.6/extensions/Chart/src/ParserFunction.php(115)
#0/srv/mediawiki/php-1.44.0-wmf.6/extensions/Chart/src/ParserFunction.php(115)MWExceptionHandler::handleError(int, string, string, int, array)
#1/srv/mediawiki/php-1.44.0-wmf.6/extensions/Chart/src/ParserFunction.php(93)MediaWiki\Extension\Chart\ParserFunction->render(MediaWiki\Parser\Parser, string)
#2/srv/mediawiki/php-1.44.0-wmf.6/includes/parser/Parser.php(3444)MediaWiki\Extension\Chart\ParserFunction::funcHook(MediaWiki\Parser\Parser, string)
#3/srv/mediawiki/php-1.44.0-wmf.6/includes/parser/Parser.php(3125)MediaWiki\Parser\Parser->callParserFunction(MediaWiki\Parser\PPFrame_Hash, string, array)
#4/srv/mediawiki/php-1.44.0-wmf.6/includes/parser/PPFrame_Hash.php(280)MediaWiki\Parser\Parser->braceSubstitution(array, MediaWiki\Parser\PPFrame_Hash)
#5/srv/mediawiki/php-1.44.0-wmf.6/includes/parser/Parser.php(2958)MediaWiki\Parser\PPFrame_Hash->expand(MediaWiki\Parser\PPNode_Hash_Tree, int)
#6/srv/mediawiki/php-1.44.0-wmf.6/includes/parser/Parser.php(1603)MediaWiki\Parser\Parser->replaceVariables(string)
#7/srv/mediawiki/php-1.44.0-wmf.6/includes/parser/Parser.php(705)MediaWiki\Parser\Parser->internalParse(string)
#8/srv/mediawiki/php-1.44.0-wmf.6/includes/content/WikitextContentHandler.php(384)MediaWiki\Parser\Parser->parse(string, MediaWiki\Title\Title, MediaWiki\Parser\ParserOptions, bool, bool, null)
#9/srv/mediawiki/php-1.44.0-wmf.6/includes/content/ContentHandler.php(1697)MediaWiki\Content\WikitextContentHandler->fillParserOutput(MediaWiki\Content\WikitextContent, MediaWiki\Content\Renderer\ContentParseParams, MediaWiki\Parser\ParserOutput)
#10/srv/mediawiki/php-1.44.0-wmf.6/includes/content/Renderer/ContentRenderer.php(79)MediaWiki\Content\ContentHandler->getParserOutput(MediaWiki\Content\WikitextContent, MediaWiki\Content\Renderer\ContentParseParams)
#11/srv/mediawiki/php-1.44.0-wmf.6/includes/editpage/EditPage.php(4240)MediaWiki\Content\Renderer\ContentRenderer->getParserOutput(MediaWiki\Content\WikitextContent, MediaWiki\Title\Title, null, MediaWiki\Parser\ParserOptions)
#12/srv/mediawiki/php-1.44.0-wmf.6/includes/editpage/EditPage.php(4143)MediaWiki\EditPage\EditPage->doPreviewParse(MediaWiki\Content\WikitextContent)
#13/srv/mediawiki/php-1.44.0-wmf.6/includes/editpage/EditPage.php(3011)MediaWiki\EditPage\EditPage->getPreviewText()
#14/srv/mediawiki/php-1.44.0-wmf.6/includes/editpage/EditPage.php(789)MediaWiki\EditPage\EditPage->showEditForm()
#15/srv/mediawiki/php-1.44.0-wmf.6/includes/actions/EditAction.php(66)MediaWiki\EditPage\EditPage->edit()
#16/srv/mediawiki/php-1.44.0-wmf.6/includes/actions/SubmitAction.php(38)EditAction->show()
#17/srv/mediawiki/php-1.44.0-wmf.6/includes/actions/ActionEntryPoint.php(733)SubmitAction->show()
#18/srv/mediawiki/php-1.44.0-wmf.6/includes/actions/ActionEntryPoint.php(510)MediaWiki\Actions\ActionEntryPoint->performAction(Article, MediaWiki\Title\Title)
#19/srv/mediawiki/php-1.44.0-wmf.6/includes/actions/ActionEntryPoint.php(146)MediaWiki\Actions\ActionEntryPoint->performRequest()
#20/srv/mediawiki/php-1.44.0-wmf.6/includes/MediaWikiEntryPoint.php(201)MediaWiki\Actions\ActionEntryPoint->execute()
#21/srv/mediawiki/php-1.44.0-wmf.6/index.php(58)MediaWiki\MediaWikiEntryPoint->run()
#22/srv/mediawiki/w/index.php(3)require(string)
#23{main}
Impact
Notes

Details

Request URL
https://www.mediawiki.org/w/index.php?action=submit&title=*

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald Transcript

The bug was trivial to locate -- it's a missing []. What is interesting though is phan not catching it despite having accurate type information. Not even in strict mode! So, I filed upstream issue https://github.com/phan/phan/issues/4892.

Change #1101204 had a related patch set uploaded (by Daimona Eaytoy; author: Daimona Eaytoy):

[mediawiki/extensions/Chart@master] Add missin array append operator

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

Change #1101204 merged by jenkins-bot:

[mediawiki/extensions/Chart@master] Add missing array append operator

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