Page MenuHomePhabricator

distinguish between local and shared repository dupes
Closed, ResolvedPublic

Description

The current dupelist links exclusively to the local project's file description page. This could lead to wrong links in a situation like the following:

  • We are on Image:foo.jpg
  • There is a dupe version at shared under Image:bar.jpg
  • Local Image:bar.jpg differs from Image:foo.jpg

Same could happen the other way round:

  • A user tags Image:bla.jpg as NowCommons under the name Image:bla2.jpg
  • Local Image:bla2.jpg is a dupe of Image:bla.jpg
  • Shared Image:bla2.jpg is a different file

Both problems massively limit the applicability of the dupe list.


Version: 1.13.x
Severity: minor

Details

Reference
bz14147

Event Timeline

bzimport raised the priority of this task from to Medium.Nov 21 2014, 10:11 PM
bzimport set Reference to bz14147.

Bryan.TongMinh wrote:

Can you give me an example? I can't reproduce this; on my local wiki external links are used to distinguish between local and shared files.

Exa(In reply to comment #1)

Can you give me an example? I can't reproduce this; on my local wiki external
links are used to distinguish between local and shared files.

One example from [[de:Category:NowCommons]]:

http://de.wikipedia.org/wiki/Bild:Albrecht-v-Preussen.JPG links to http://de.wikipedia.org/wiki/Bild:Albertvanpruisen.jpg but should link to http://commons.wikimedia.org/wiki/Image:Albertvanpruisen.jpg

Bryan.TongMinh wrote:

For some reason a LocalFile is created instead of a LocalDBFile, but the repository is clearly still the shared repository.

Also note the bug that the namespace is translated.

Bryan.TongMinh wrote:

I can't find the problem. It appears that ForeignDBRepo::newFileFromRow creates an LocalFile. There can be a few possibilities:

  • ForeignDBRepo::findFilesBySha1 is directly inherited from LocalRepo, so it may call LocalRepo::newFileFromRow.
  • ForeignDBFile::newFromRow creates a LocalFile instead of a ForeignDBFile.

Both do not occur to me on a local system, but maybe there is some version incompability between PHP or some caching problem?

Bryan.TongMinh wrote:

Fixed by brion in r35576.