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 created this task.Jun 25 2015, 3:28 AM
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 project: Multimedia. · View Herald TranscriptJun 25 2015, 3:28 AM
Restricted Application added a subscriber: Aklapper. · View Herald Transcript
Tgr added a subscriber: Tgr.Jun 25 2015, 3:40 AM

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

Restricted Application added a subscriber: Matanya. · View Herald TranscriptJul 6 2015, 8:07 PM
Tgr added a comment.EditedJul 6 2015, 9:27 PM

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

Tgr added a comment.Jul 8 2015, 10:21 PM

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 updated the task description. (Show Details)Jul 8 2015, 10:27 PM
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

Legoktm claimed this task.Jul 8 2015, 10:53 PM
Anomie moved this task from Unsorted to Done on the MediaWiki-API board.Jul 9 2015, 1:24 PM

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

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

Anomie added a subscriber: Anomie.Jul 9 2015, 3:16 PM

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

demon added a comment.Jul 9 2015, 4:53 PM

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

Umherirrender closed this task as Resolved.Jul 13 2015, 5:36 PM