Last modified: 2014-02-12 23:35:51 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T47930, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 45930 - 'redirects' not working for prop=imageinfo and commons redirects
'redirects' not working for prop=imageinfo and commons redirects
Status: PATCH_TO_REVIEW
Product: MediaWiki
Classification: Unclassified
API (Other open bugs)
unspecified
All All
: Normal normal with 1 vote (vote)
: ---
Assigned To: Nobody - You can work on this!
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2013-03-09 12:30 UTC by Svick
Modified: 2014-02-12 23:35 UTC (History)
6 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description Svick 2013-03-09 12:30:52 UTC
As I understand it, with prop=imageinfo and redirects, the API should follow redirects on commons too, but it doesn't seem to.

For example, the query

http://en.wikipedia.org/w/api.php?action=query&titles=File:Wodan%20Heilt%20Balders%20Pferd%20by%20Emil%20Doepler.jpg&prop=imageinfo&redirects

doesn't return any imageinfo, even though [[commons:File:Wodan Heilt Balders Pferd by Emil Doepler.jpg]] is a redirect to [[commons:File:Wodan heilt Balders Pferd by Emil Doepler.jpg]] (lowercase h).
Comment 1 Brad Jorsch 2013-03-12 15:43:42 UTC
A little brainstorming possible solutions, that won't re-cause some of the past bugs related to imageinfo and redirects:

1. Make FileRepo::findFiles() use the passed-in titles as the keys in the result array, rather than the redirected title dbkeys.

2. Make sure checkRedirect() works for all repos (e.g. it doesn't right now for ForeignAPIRepo), then in ApiQueryImageInfo if the title isn't found in the image array call that and check again.

3. Give up on findFiles() entirely, and just call findFile() on each title. Removes the possibility for optimizing ForeignAPIRepo, but ForeignAPIRepo doesn't currently optimize anyway.

Note that ApiQueryDuplicateFiles and TimedMediaHandler's ApiQueryVideoInfo and ApiTranscodeStatus probably have the same sort of issues.
Comment 2 piotr.jagielski 2013-04-21 09:12:29 UTC
Is there any workaround to get image info of a file redirected on commons by using the original image name until this issue is addressed?
Comment 3 Gerrit Notification Bot 2013-12-06 21:31:52 UTC
Change 99738 had a related patch set uploaded by Aaron Schulz:
Tweaked FileRepo::findFiles() behavoir to match LocalRepo

https://gerrit.wikimedia.org/r/99738
Comment 4 Gerrit Notification Bot 2013-12-11 16:51:53 UTC
Change 99738 merged by jenkins-bot:
Tweaked FileRepo::findFiles() behavoir to match LocalRepo

https://gerrit.wikimedia.org/r/99738
Comment 5 Bawolff (Brian Wolff) 2013-12-11 16:53:28 UTC
I'm going to look into trying to make file redirects behave like normal redirects (in regards to triggering on &redirects=1 and no special handling in imageinfo module)
Comment 6 Gerrit Notification Bot 2013-12-11 22:48:06 UTC
Change 100921 had a related patch set uploaded by Brian Wolff:
[WIP] Make API follow file redirects like normal redirects

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

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links