List of steps to reproduce (step by step, including full links if applicable):
- Link to a page through a redirect.
- Go to https://commons.wikimedia.beta.wmflabs.org/wiki/File:Gg76f2dbef4cc9_24_43.jpg and notice under "File usage on Commons" how it says User:AJ/Sandbox4 is using it through the "File:Gg76f2dbef4cc9 24 42.jpg" redirect.
- Go to https://commons.wikimedia.beta.wmflabs.org/wiki/Special:WhatLinksHere/File:Gg76f2dbef4cc9_24_43.jpg and notice how it says User:AJ/Sandbox4 is linking the file through the File:Gg76f2dbef4cc9 24 42.jpg redirect. (the page both uses and links the file)
- Go to https://commons.wikimedia.beta.wmflabs.org/w/api.php?action=query&prop=linkshere&lhlimit=500&format=json&titles=File%3AGg76f2dbef4cc9_24_43.jpg and notice the absence of User:AJ/Sandbox4.
- Go to https://commons.wikimedia.beta.wmflabs.org/w/api.php?action=query&prop=fileusage&fuprop=title&fulimit=500&format=json&titles=File%3AGg76f2dbef4cc9_24_43.jpg and notice the absence of User:AJ/Sandbox4.
- For a regular (non-file) page, see how Special:WhatLinksHere/Bert reports the link on User:AJ/sandbox while the API ignores the use through the Berta redirect.
What happens?:
A page that clearly uses and links the file isn't reported in an API query for linkshere and fileusage.
What should have happened instead?:
Pretty sure the API usually reports pages that link or use the file..
Software version (if not a Wikimedia wiki), browser information, screenshots, other information, etc:
https://commons.wikimedia.beta.wmflabs.org/
{"batchcomplete":"","query":{"normalized":[{"from":"File:Gg76f2dbef4cc9_24_43.jpg","to":"File:Gg76f2dbef4cc9 24 43.jpg"}],"pages":{"100000":{"pageid":100000,"ns":6,"title":"File:Gg76f2dbef4cc9 24 43.jpg"}}}}
{"batchcomplete":"","query":{"normalized":[{"from":"File:Gg76f2dbef4cc9_24_43.jpg","to":"File:Gg76f2dbef4cc9 24 43.jpg"}],"pages":{"100000":{"pageid":100000,"ns":6,"title":"File:Gg76f2dbef4cc9 24 43.jpg","linkshere":[{"pageid":104137,"ns":6,"title":"File:Gg76f2dbef4cc9 24 39.jpg","redirect":""},{"pageid":104138,"ns":6,"title":"File:Gg76f2dbef4cc9 24 40.jpg","redirect":""},{"pageid":104139,"ns":6,"title":"File:Gg76f2dbef4cc9 24 41.jpg","redirect":""},{"pageid":104168,"ns":6,"title":"File:Gg76f2dbef4cc9 24 42.jpg","redirect":""}]}}}}
The normalization doesn't seem to affect this.