Page MenuHomePhabricator

"Error: Cannot use object of type stdClass as array"
Closed, DuplicatePublicPRODUCTION ERROR

Description

image.png (368×676 px, 59 KB)

The error occured when this mapframe is added to the wikitext :

<mapframe>
{"features":[{"geometry":{"coordinates":[[[106.81574510639167,-6.187092760990937],[106.83022436793894,-6.1872160579678415]],[[106.83022436793894,-6.1872160579678415],[106.83437901686258,-6.183517136151198]]],"type":"MultiLineString"},"properties":{"felt-color":"RED","felt-routeMode":"DRIVING","felt-showLength":false,"felt-type":"Path"},"type":"Feature"}],"metadata":{"felt-version":1},"type":"FeatureCollection"}
</mapframe>

Video proof:

Error
normalized_message
[{reqId}] {exception_url}   Error: Cannot use object of type stdClass as array
exception.trace
from /srv/mediawiki/php-1.40.0-wmf.3/extensions/Kartographer/includes/Tag/TagHandler.php(429)
#0 /srv/mediawiki/php-1.40.0-wmf.3/extensions/Kartographer/includes/Tag/TagHandler.php(411): Kartographer\Tag\TagHandler->getJSONValidatorLog(array)
#1 /srv/mediawiki/php-1.40.0-wmf.3/extensions/Kartographer/includes/Tag/TagHandler.php(134): Kartographer\Tag\TagHandler->reportError()
#2 /srv/mediawiki/php-1.40.0-wmf.3/extensions/Kartographer/includes/Tag/TagHandler.php(104): Kartographer\Tag\TagHandler->handle(string, array, Parser, PPFrame_Hash)
#3 /srv/mediawiki/php-1.40.0-wmf.3/includes/parser/Parser.php(4012): Kartographer\Tag\TagHandler::entryPoint(string, array, Parser, PPFrame_Hash)
#4 /srv/mediawiki/php-1.40.0-wmf.3/includes/parser/PPFrame_Hash.php(354): Parser->extensionSubstitution(array, PPFrame_Hash, boolean)
#5 /srv/mediawiki/php-1.40.0-wmf.3/includes/parser/Parser.php(2944): PPFrame_Hash->expand(PPNode_Hash_Tree, integer)
#6 /srv/mediawiki/php-1.40.0-wmf.3/includes/parser/Parser.php(1599): Parser->replaceVariables(string)
#7 /srv/mediawiki/php-1.40.0-wmf.3/includes/parser/Parser.php(713): Parser->internalParse(string)
#8 /srv/mediawiki/php-1.40.0-wmf.3/includes/content/WikitextContentHandler.php(301): Parser->parse(string, Title, ParserOptions, boolean, boolean, NULL)
#9 /srv/mediawiki/php-1.40.0-wmf.3/includes/content/ContentHandler.php(1721): WikitextContentHandler->fillParserOutput(WikitextContent, MediaWiki\Content\Renderer\ContentParseParams, ParserOutput)
#10 /srv/mediawiki/php-1.40.0-wmf.3/includes/content/Renderer/ContentRenderer.php(47): ContentHandler->getParserOutput(WikitextContent, MediaWiki\Content\Renderer\ContentParseParams)
#11 /srv/mediawiki/php-1.40.0-wmf.3/includes/EditPage.php(4529): MediaWiki\Content\Renderer\ContentRenderer->getParserOutput(WikitextContent, Title, NULL, ParserOptions)
#12 /srv/mediawiki/php-1.40.0-wmf.3/includes/EditPage.php(4432): EditPage->doPreviewParse(WikitextContent)
#13 /srv/mediawiki/php-1.40.0-wmf.3/includes/EditPage.php(3141): EditPage->getPreviewText()
#14 /srv/mediawiki/php-1.40.0-wmf.3/includes/EditPage.php(778): EditPage->showEditForm()
#15 /srv/mediawiki/php-1.40.0-wmf.3/includes/actions/EditAction.php(73): EditPage->edit()
#16 /srv/mediawiki/php-1.40.0-wmf.3/includes/actions/SubmitAction.php(38): EditAction->show()
#17 /srv/mediawiki/php-1.40.0-wmf.3/includes/MediaWiki.php(542): SubmitAction->show()
#18 /srv/mediawiki/php-1.40.0-wmf.3/includes/MediaWiki.php(322): MediaWiki->performAction(Article, Title)
#19 /srv/mediawiki/php-1.40.0-wmf.3/includes/MediaWiki.php(904): MediaWiki->performRequest()
#20 /srv/mediawiki/php-1.40.0-wmf.3/includes/MediaWiki.php(562): MediaWiki->main()
#21 /srv/mediawiki/php-1.40.0-wmf.3/index.php(50): MediaWiki->run()
#22 /srv/mediawiki/php-1.40.0-wmf.3/index.php(46): wfIndexMain()
#23 /srv/mediawiki/w/index.php(3): require(string)
#24 {main}
Impact
Notes

Details

MediaWiki Version
1.40.0-wmf.3
Request URL
https://id.wikipedia.org/w/index.php?action=submit&title=*

Event Timeline

Apparently, this issue is solved if we specified the exact dimension of the mapframe.

<mapframe text="Koridor 2 Trans Semanggi Suroboyo (SPBU Menganti - Kejawan Putih Tambak)" width="350" height="350" zoom="13" >
{"features":[{"geometry":{"coordinates":[[[106.81574510639167,-6.187092760990937],[106.83022436793894,-6.1872160579678415]],[[106.83022436793894,-6.1872160579678415],[106.83437901686258,-6.183517136151198]]],"type":"MultiLineString"},"properties":{"felt-color":"RED","felt-routeMode":"DRIVING","felt-showLength":false,"felt-type":"Path"},"type":"Feature"}],"metadata":{"felt-version":1},"type":"FeatureCollection"}
</mapframe>
Aklapper changed the subtype of this task from "Bug Report" to "Production Error".Sep 30 2022, 7:25 PM

Hi @Rtnf, thanks for taking the time to report this! Please always provide text as text, so text can be copied or searched for.
6a372960-5db4-4607-a4b0-4cb0ecc2444f

Aklapper renamed this task from Kartographer is causing Internal Error to "Error: Cannot use object of type stdClass as array".Sep 30 2022, 7:27 PM
Aklapper set Request URL to https://id.wikipedia.org/w/index.php?action=submit&title=*.
Aklapper updated the task description. (Show Details)
Aklapper set Release Version to 1.40.0-wmf.3.