FileImport does not work with foreign file namespaces
Open, Needs TriagePublic

Description

What happens:
When trying to import a file from a wiki project that uses different namespace identifiers for files, the importer gets confused about the colon character in the filename.

e.g. Try to import https://de.wikipedia.org/wiki/Datei:Barmbek.png

You will get The title you are currently trying to import to contains invalid filename characters. warning with Datei:Barmbek.png in the filename input field

Expected behavior:
Autodetect the foreign file namespace and remove it from the title.

Restricted Application added a subscriber: Aklapper. · View Herald TranscriptJul 6 2017, 11:02 AM
WMDE-Fisch added a comment.EditedJul 6 2017, 11:03 AM

Also note, that in this case he keeps the file extension also as part of the filename input field.

Change 363588 had a related patch set uploaded (by Addshore; owner: Addshore):
[mediawiki/extensions/FileImporter@master] Fix ApiDetailRetriever for foreign file namespaces

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

Change 363588 merged by jenkins-bot:
[mediawiki/extensions/FileImporter@master] Fix ApiDetailRetriever for foreign file namespaces

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

WMDE-Fisch moved this task from Done to Todo on the WMDE-QWERTY-Team-Board board.Jul 14 2017, 11:17 AM

There seems to be a remaining issue with importing files from foreign namespaces. Steps to reproduce:

  • import a file from a foreign namspace without changes e.g. https://fr.wikipedia.org/wiki/Fichier:Terredesfemmes.png
  • now try to click the link where the file should be moved to e.g. File:Terredesfemmes.png
  • the file will not be there
  • try to import the same file again
  • the importer will complain that the file already exists with following link File:Fichier:Terredesfemmes.png

You see, that the foreign namespace (Fichier:) became a part of the new file title.

Change 366239 had a related patch set uploaded (by WMDE-Fisch; owner: WMDE-Fisch):
[mediawiki/extensions/FileImporter@master] Remove foreign NS when importing file

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

WMDE-Fisch moved this task from Todo to Currently in sprint on the WMDE-QWERTY-Team-Board board.

Change 366239 merged by jenkins-bot:
[mediawiki/extensions/FileImporter@master] Remove foreign NS when importing file

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