Page MenuHomePhabricator

Transwiki import summary link uses local namespace name which may not be defined on source wiki
Closed, ResolvedPublic

Description

When importing [[arz:قالب:Country data Cape Verde/doc]] (which is a template documentation page) from English Wikipedia to Egyptian Arabic (arz) Wikipedia, the edit summary of the import process

1 تعديل من en:قالب:Country data Cape Verde/doc: قالب متعاز و لسه محتاج ترجمه

contains a link to [[en:قالب:Country data Cape Verde/doc]] which is wrong because it shows the localized name of the template namespace in Arabic (قالب). Instead, the link should be [[en:Template:Country data Cape Verde/doc]].


Version: 1.21.x
Severity: minor
URL: http://arz.wikipedia.org/w/index.php?title=%D9%82%D8%A7%D9%84%D8%A8%3ACountry_data_Cape_Verde%2Fdoc&diff=416513&oldid=416512

Details

Event Timeline

bzimport raised the priority of this task from to Medium.Nov 22 2014, 12:49 AM
bzimport set Reference to bz40192.
bzimport added a subscriber: Unknown Object (MLST).

I just took a look at this:

As far as I can tell, the problem here is that the WikiImporter class (in Import.php) uses a Title object to store the title of the original page. However, WikiImporter doesn't know about interwiki prefixes, so it creates a Title with no interwiki prefix. This causes the Title class to assume it is dealing with a local page, so it uses local namespace names when generating a display form of the title.

This could partly be solved by always using canonical namespace names in the edit summary. However, that would probably fail in the following scenario:

  • import "Portal:Foo" to a wiki where "Portal" is set as a namespace alias for the "Portada" namespace
  • Title object returns a link to "Portada:Foo", which doesn't exist on the source wiki

But I am inclined to think it is a better stopgap solution (fixes the vast majority of cases) until someone can be bothered to overhaul WikiImporter!

Change 84197 had a related patch set uploaded by TTO:
Make the link in import log entry always use canonical namespace

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

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

Change 149293 had a related patch set uploaded by TTO:
Proper namespace handling for WikiImporter

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

Change 84197 abandoned by TTO:
Make the link in import log entry always use canonical namespace

Reason:
OK, I decided to do this *for real* this time. See Iaa58e1b9fd

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

Change 149293 had a related patch set uploaded (by TTO):
Proper namespace handling for WikiImporter

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

Patch-For-Review

Change 149293 had a related patch set (by TTO) published:
Proper namespace handling for WikiImporter

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

Patch-For-Review

Change 149293 had a related patch set (by TTO) published:
Proper namespace handling for WikiImporter

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

Patch-For-Review

Change 149293 merged by jenkins-bot:
Proper namespace handling for WikiImporter

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

TTO claimed this task.

Pretty sure this should be fixed by that patch.