This task is about creating an extension for moving files to Commons. The extension should:
- get the url of a file (any wikiproject is allowed)
- Check if the file name already exists on Commons. If yes: Don't do any moving, but let the user know instead, that the file cannot be moved due to name conflicts. If no, do the following steps:
- copy all info:
- description history
- file history
- binary file itself (all versions)
- if the file is from WP, map the WP template to the Commons template, based on the existing [[ https://bitbucket.org/magnusmanske/commonshelper/src/1948dc46f67f1a05981474839e73d90a024a85ac/public_html/transwiki_data.php?at=master&fileviewer=file-view-default | Commonshelper list ]]
So that the Commons file page looks exactly as it would have looked, had the file been uploaded on Commons in the first place
To the version history, add two entries:
- The file move
- Edit summary: "Automatically moved here from <source url> by <mover's name>"
- the template applied (if there was a template used)
- Edit summary: "Automatically applied the <template name> template"
Both entries should be separated, so that you can rollback the template application independently from the move.
Do not allow an undoing of the move from the version history page.
**Technical discussions that have already happened**
- As long as there are no global user-ids, this is more complicated (however, #community-tech is working on that)
- The copying of binary files might be challenging: We might need to copy them from the SWIFT-backend itself
- In general, API calls are preferred to moves/line copies directly from the db, but we might need to know all the different APIs from the wikiprojects
- In order to better handle problems that might occur during the file move, it might be best to do things in the following order:
- Copy file description with title etc
- Copy binary files
- Add the log entries
**Background**:
This is part of fulfilling on wish of the German-community speaking wishlist of 2013. For details see the parent task