Page MenuHomePhabricator

Redirects to Images on Shared Repos do not work
Open, MediumPublic

Description

Author: overlordq

Description:
If a page embeds local [[File:A.jpg]] which is then moved to [[File:B.jpg]] pages embedding [[File:A.jpg]] still work. However if [[File:A.jpg]] is moved to a shared repo (such as commons) and deleted locally, all pages that embed [[File:A.jpg]] will contain broken images.

Ideally, these images should continue to work.


Version: 1.15.x
Severity: normal

Details

Reference
bz18248

Event Timeline

bzimport raised the priority of this task from to Medium.Nov 21 2014, 10:36 PM
bzimport set Reference to bz18248.
bzimport added a subscriber: Unknown Object (MLST).

Known bug, just hadn't filed it yet.

Assigning to Victor. He was the one who implemented this, and I've banged me head up against walls trying to get it work. Told me a week or so ago he'd take a poke.

Bryan.TongMinh wrote:

*** Bug 20804 has been marked as a duplicate of this bug. ***

Bryan.TongMinh wrote:

Proposed patch

Patch that achieves the functionality.

The problem with this is that not only the local redirect table is followed, but also the foreign one i.e. if Commons file [[File:Redirect to A.jpg]] redirects to [[File:A.jpg]], it will first look to a local file named [[File:A.jpg]]. There are few options:

  • First check the current repo and only then pass over control to wfFindFile
  • Follow only redirects to non-local files from local files only
  • Not care at all, as this behaviour is a reasonable default.

attachment patch.txt ignored as obsolete

Mass component change for merge of "File/Repo" and "Images and Files"

  • Bug 22541 has been marked as a duplicate of this bug. ***

Grah, I see I duplicated the effort on this :( I kinda assumed that there would not have been a patch yet in bugzilla for this.

I'm not sure if this patch would work for ForeignAPIRepo though...

Bryan.TongMinh wrote:

*** Bug 23664 has been marked as a duplicate of this bug. ***

Confirming that file redirects to files on Commons on outreach.wikimedia and en.wiki only display the redirect and do not actually go through.

Example: http://outreach.wikimedia.org/wiki/File:Free_licenses.pdf
Sandbox: http://outreach.wikimedia.org/w/index.php?title=Sandbox&oldid=16242 (only links to file)

Thanks. I confirmed it way back in comment 1.

Bryan.TongMinh wrote:

*** Bug 32658 has been marked as a duplicate of this bug. ***

sumanah wrote:

Comment on attachment 6582
Proposed patch

This patch no longer cleanly applies to SVN trunk per Rusty Burchfield's automated testing
https://docs.google.com/spreadsheet/ccc?key=0Ah_71HHl7qa7dGtvSms3TGpHQU9NU2Y1VmNzUEUteWc .

sumanah wrote:

Bryan, sorry, removing the need-review and patch keywords since your patch doesn't cleanly apply to trunk. Is it quick for you to update and reattach, or commit after the code slush ends?

Bryan.TongMinh wrote:

(In reply to comment #13)

Bryan, sorry, removing the need-review and patch keywords since your patch
doesn't cleanly apply to trunk. Is it quick for you to update and reattach, or
commit after the code slush ends?

We first need to establish that the behaviour described in comment #3 is acceptable.

rd232 wrote:

Is this the same as Bug 28299 - An image redirect from a foreign File Repo overrides local wiki page?

Not really. That bug talks about how having a (local) redirect affects all versions in the history of the page. This bug describes what happens if you create a local redirect to a file not found on the local Wiki.