Page MenuHomePhabricator

PHP Notice: "Undefined index: value in includes/filerepo/file/ForeignAPIFile.php:201"
Closed, ResolvedPublic

Description

MediaWiki uses [['name' => <name>, 'value' => <value>'], ...] for the image metadata format at varius places. The imageinfo API exposes this via iiprop=metadata, but the default (formatversion=1) JSON formatter swallows fields with a value of boolean false, so value can be missing. This causes warnigns in InstantCommons (and probably breaks some other things).

Event Timeline

Krinkle raised the priority of this task from to Needs Triage.
Krinkle updated the task description. (Show Details)
Krinkle added a subscriber: Krinkle.
Restricted Application added a subscriber: Aklapper. · View Herald Transcript

Or even a malformed response from the Commons imageinfo API. Do we know which files throw this?

The metadata provided by the Commons API is malformed (looped does not have a value).

looped comes from mediawiki/includes/media/GIFMetadataExtractor.php which always sets it to boolean. The API handles fields with a boolean false value weirdly (compare with the formatversion=2 API response).

Tgr edited projects, added MediaWiki-API; removed MediaWiki-File-management.
Tgr set Security to None.

Change 223698 had a related patch set uploaded (by Legoktm):
APIQueryImageInfo: Set META_BC_BOOLS for 'value' in 'metadata' block

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

Change 223698 merged by jenkins-bot:
APIQueryImageInfo: Set META_BC_BOOLS for 'value' in 'metadata' block

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

The API part of this is done with the merge of Lego's patch. Does anyone want to keep it open for backporting to 1.25.$NEXT or for making ForeignAPIFile more robust against this issue?

demon triaged this task as Medium priority.Jul 9 2015, 4:29 PM
demon added a subscriber: demon.

Change 223824 had a related patch set uploaded (by Chad):
APIQueryImageInfo: Set META_BC_BOOLS for 'value' in 'metadata' block

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

Backported to 1.25 in above ^

Change 223824 merged by jenkins-bot:
APIQueryImageInfo: Set META_BC_BOOLS for 'value' in 'metadata' block

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