Page MenuHomePhabricator

Make it harder to accidentally import with templates
Open, Needs TriagePublic

Description

Ticking "Include all templates and transcluded pages" when doing an import should require some kind of confirmation. People have done this accidentally from time to time (most recently https://en.wikipedia.org/wiki/Wikipedia:Administrators%27_noticeboard/Archive361#Cleanup_for_an_import_booboo), and it is a complete pain to undo.

Ideally it would list the pages you are going to import, and say "are you sure you want to import these pages" before continuing.


Description from duplicate T387455: It is way too easy to overwrite existing pages (and merging edit histories) by doing a transwiki import

On no.wikipedia (nowiki), User:1000mm imported the page "Peder Andersen" from nnwiki. When importing, they checked the "Include all templates and transcluded pages" checkbox.

The result was that 39 other pages were also imported; many (maybe even most?) of these already existed as pages in nowiki, and now their histories are a merry mix of nowiki and nnwiki history, which would be super time-consuming to untangle.

Steps to replicate the issue (include links if applicable):

  • Have transwiki importer rights on no.wikipedia.org
  • Go to Special:Import
  • Import the page "Brukar:Jon Harald Søby/Test" from nn (nn.wikipedia.org)
  • Check the "Include all templates" checkbox

What happens?:

What should have happened instead?:
At the very least, there should be an intermediate step after pressing "import", letting the user know which pages will actually be imported if they proceed, and letting them know which of those pages already exist and will have their histories messed up by this import.

Event Timeline

Meh... true for Wikimedia wikis, less true elsewhere.

I've cleaned up after an accidental import with templates that imported more stuff than it should over at https://dev.miraheze.org as well. It's not specific to Wikimedia.

It isn't, but outside Wikimedia you are far more likely to want to check that box, in particular I'm thinking of smaller wikis copying baseline templates from Wikipedia.

That being said, I didn't realize you've proposed a softer warning than what HouseBlaster wrote on-wiki. I have no objections to what you've written.

As someone who periodically imports from Wikipedia to a non-WMF wiki, I'd love to have an intermediate confirmation screen, if only so I can see exactly what pages will be getting imported (massive bonus points if we can get checkboxes to select exactly which pages we actually want to import, but technically that's a separate feature request, I think).

Took a quick look at the code to see how practical this is, and since the code as it stands parses the XML in one pass sequentially and thus doesn't even know what pages are going to be imported until it imports them fixing this would require a larger refactor than I am motivated to do or is likely to get reviewed (since the import component has no owner)

I write a pywikibot script at https://gitlab.wikimedia.org/pppery/unimport that undoes the most recent import to a page you specify. Note that it does this by delete/undelete, so you will need to reprotect the page if it was protected, reconnect it to Wikidata, etc.

I write a pywikibot script at https://gitlab.wikimedia.org/pppery/unimport that undoes the most recent import to a page you specify. Note that it does this by delete/undelete, so you will need to reprotect the page if it was protected, reconnect it to Wikidata, etc.

Deletion of heavily used templates (such as {{tl}}) even temporarily is highly disruptive, so what would be useful is T213617: Selective delete of edits.

You're welcome to develop an unimport that creates a temp page, uses Special:MergeHistory to move the history back, and then wraps my unimport, if you wish. That's more log entries, more complicated, and IMO not worth it.