Page MenuHomePhabricator

ForeignAPIRepo should ignore file redirects to non-file
Open, LowPublic

Description

r66724 added &redirects=true for bug 22541, but when a file page on a foreign wiki is redirecting to a non-file and used via ForeignAPIRepo, the redirect target's info is fetched so there won't be $data['query']['pages'][]['imageinfo'], causing a red file link.

However, when the file is used directly on that foreign wiki, the redirect is ignored. ForeignAPIRepo should follow this behavior (ie. when a file is redirecting to a non-file, remove &redirects=true and try again).


Version: unspecified
Severity: normal

Details

Reference
bz42610

Event Timeline

bzimport raised the priority of this task from to Low.Nov 22 2014, 1:10 AM
bzimport set Reference to bz42610.
bzimport added a subscriber: Unknown Object (MLST).

shifuimam wrote:

It looks like the patch to address bug 23750 addresses this issue. This can probably be closed as a duplicate.

(In reply to comment #1)

It looks like the patch to address bug 23750 addresses this issue. This can
probably be closed as a duplicate.

That change may get ForeignAPIRepo more confused. A query api.php?action=query&titles=File:GEDC0534.jpg&prop=imageinfo&redirects&format=jsonfm shows this now:

{

"query": {
    "redirects": [
        {
            "from": "File:GEDC0534.jpg",
            "to": "Main Page"
        }
    ],
    "pages": {
        "12": {
            "pageid": 12,
            "ns": 0,
            "title": "Main Page",
            "imagerepository": ""
        },
        "52": {
            "imagerepository": "local",
            "imageinfo": [
                {
                    "timestamp": "2013-01-23T08:18:55Z",
                    "user": "Liangent"
                }
            ]
        }
    }
}

}

Now it's difficult to find out what $data['query']['pages']['52'] is.

shifuimam wrote:

I'm not sure I follow. I did see that you updated the other bug that the change has been merged. Am I correct in believing that change will resolve this issue? The other bug is more or less identical to what this bug was originally created for - images from foreign API repos that redirect to non-image pages don't display correctly, due to the API not returning the URL of the actual image file if it redirects.