Page MenuHomePhabricator

Foreign files don't get page images
Closed, ResolvedPublic

Description

In English Wikipedia if I request the page image for File:Mahkama du Pacha.jpg I don't get one. Expected: The page image should be itself.
https://en.m.wikipedia.org/wiki/Special:ApiSandbox?useformat=desktop#action=query&prop=pageimages&format=json&piprop=thumbnail&titles=File%3AMahkama%20du%20Pacha.jpg

The page image should be itself.

Note: This impacts Gather collections: https://en.m.wikipedia.org/wiki/Special:Gather/id/657/May

Event Timeline

Jdlrobson raised the priority of this task from to Needs Triage.
Jdlrobson updated the task description. (Show Details)
Jdlrobson added projects: PageImages, Gather.
Jdlrobson subscribed.
Jdlrobson updated the task description. (Show Details)
Jdlrobson edited projects, added good first task; removed Gather.
Jdlrobson set Security to None.
Jdlrobson added a project: Web-Team-Backlog.
Jhernandez moved this task from Incoming to 2016-17 Q2 on the Web-Team-Backlog board.
Jhernandez subscribed.
Jhernandez raised the priority of this task from Medium to High.Aug 14 2015, 9:04 AM

This would make adding File pages to collections work better.

ApiQueryPageImages#execute gets the titles it's going to work with from ApiPageSet#getGoodTitles, which discards, amongst others, all titles corresponding to foreign files.

However, ApiQueryPageImages#execute handles titles in filespace distinctly from titles in any other namespace. In fact, it defers to wfFindFile to both validate the title and fetch the corresponding file, if any, which is ideal. Therefore, we should only have to include missing filespace titles – using ApiPageSet#getMissingTitlesByNamespace – when we're processing filespace titles.

Change 242835 had a related patch set uploaded (by Phuedx):
Include foreign files in ApiQueryPageImages

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

Change 242835 merged by jenkins-bot:
Include foreign files in ApiQueryPageImages

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

A similar issue seems to impact TextExtracts. T114418
This change is working a charm on http://en.m.wikipedia.beta.wmflabs.org/wiki/Special:Gather/id/167 - thanks!

Sorry for the headache @Jdlrobson, @greg and thanks for the revert @Legoktm.

Change 243124 had a related patch set uploaded (by Phuedx):
Revert "Revert "Include foreign files in ApiQueryPageImages""

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

Change 243124 merged by jenkins-bot:
Include foreign files in ApiQueryPageImages

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

Confirmed on beta labs http://en.m.wikipedia.beta.wmflabs.org/wiki/Special:Gather/id/167
Have seen no significant spike in fatals this time (touch wood).