Page MenuHomePhabricator

PHP Notice: A non well formed numeric value encountered (FormatMetadata.php)
Closed, ResolvedPublicPRODUCTION ERROR

Description

Error

MediaWiki version: 1.36.0-wmf.20

message
PHP Notice: A non well formed numeric value encountered

Impact

Notes

See also: T267370

Details

Request ID
X8kXJApAMNEAATt0--4AAAAI
Request URL
https://commons.wikimedia.org/wiki/File:2008-11-09_Scheldt_river_at_Wetteren.jpg
Stack Trace
exception.trace
#0 /srv/mediawiki/php-1.36.0-wmf.20/includes/media/FormatMetadata.php(707): MWExceptionHandler::handleError(integer, string, string, integer, array)
#1 /srv/mediawiki/php-1.36.0-wmf.20/includes/media/FormatMetadata.php(93): FormatMetadata->makeFormattedData(array)
#2 /srv/mediawiki/php-1.36.0-wmf.20/includes/media/MediaHandler.php(568): FormatMetadata::getFormattedData(array, RequestContext)
#3 /srv/mediawiki/php-1.36.0-wmf.20/includes/media/ExifBitmapHandler.php(138): MediaHandler->formatMetadataHelper(array, RequestContext)
#4 /srv/mediawiki/php-1.36.0-wmf.20/includes/filerepo/file/File.php(1919): ExifBitmapHandler->formatMetadata(LocalFile, RequestContext)
#5 /srv/mediawiki/php-1.36.0-wmf.20/includes/page/ImagePage.php(131): File->formatMetadata(RequestContext)
#6 /srv/mediawiki/php-1.36.0-wmf.20/includes/actions/ViewAction.php(74): ImagePage->view()
#7 /srv/mediawiki/php-1.36.0-wmf.20/includes/MediaWiki.php(532): ViewAction->show()
#8 /srv/mediawiki/php-1.36.0-wmf.20/includes/MediaWiki.php(316): MediaWiki->performAction(ImagePage, Title)
#9 /srv/mediawiki/php-1.36.0-wmf.20/includes/MediaWiki.php(945): MediaWiki->performRequest()
#10 /srv/mediawiki/php-1.36.0-wmf.20/includes/MediaWiki.php(548): MediaWiki->main()
#11 /srv/mediawiki/php-1.36.0-wmf.20/index.php(53): MediaWiki->run()
#12 /srv/mediawiki/php-1.36.0-wmf.20/index.php(46): wfIndexMain()
#13 /srv/mediawiki/w/index.php(3): require(string)
#14 {main}

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald Transcript
Krinkle renamed this task from PHP Notice: A non well formed numeric value encountered to PHP Notice: A non well formed numeric value encountered (FormatMetadata.php).Dec 9 2020, 7:56 PM
Krinkle moved this task from Untriaged to Dec 2020 on the Wikimedia-production-error board.

I can't find a reference to formatNum anywhere in the MediaInfo code, so I guess this is not ours ... there's a formatNum template that's used in the French translation of wikibasemediainfo-special-mediasearch-empty-state

I can't find a reference to formatNum anywhere in the MediaInfo code, so I guess this is not ours ... there's a formatNum template that's used in the French translation of wikibasemediainfo-special-mediasearch-empty-state

formatNum exists in the Language class.

But this is from the FormatMetadata (and related) code trying to format something that isn't a number, as a number. I imagine it's probably caused (in part, though, more exposed/surfaced by than caused) by @cscott's work in that area

Similar to T266677: Use of FormatMetadata::formatNum with non-numeric value was deprecated in MediaWiki 1.36. [Called from FormatMetadata::makeFormattedData] and T267370: Use of FormatMetadata::formatNum with non-numeric value was deprecated in MediaWiki 1.36. [Called from FormatMetadata::makeFormattedData], from T263592: Use of Language::commafy with a non-numeric string was deprecated in MediaWiki 1.36. [Called from Language::formatNum].

Possibly a dupe of T267370, as the stack is very similar (but not exactly the same)

Ramsey-WMF subscribed.

Doesn't look like something in our purview, so removing from our boards 🙂

Umherirrender subscribed.

Since https://gerrit.wikimedia.org/r/c/mediawiki/core/+/640249 all non-numeric strings are treated literal and there should not be any error for this task