Page MenuHomePhabricator

Importing a page to a title that has previously been deleted should tag the import edit with Recreated, not the first imported edit
Open, Needs TriagePublicBUG REPORT

Description

Steps to replicate the issue/Proof of concept:

  • Create a page, and edit it multiple times.
  • Export the page to an XML file using Special:Export, unticking the box labelled "Include only the current revision, not the full history".
  • Delete the (now-exported) page.
  • Navigate to Special:Import, and upload the previously-exported XML file (entering anything as the interwiki prefix, and leaving the "Import to original namespace" option selected).

What happens?:
The first of the imported revisions has the 'Recreated' change tag (mw-recreated) added to it.

screenshot.png (1,896×650 px, 227 KB)

What should have happened instead?:
The first of the imported revisions should not have been tagged with mw-recreated. Instead, the edit denoting the import (by Admin in the screenshot above) should be tagged.

Software version:

Notes:

Event Timeline

Whether or not an edit that imports a page to a previously-deleted title should be tagged as 'Recreated' is probably able to be debated; however, imo, tagging the first imported edit as 'Recreated' seems like a bug because this edit will not have been the one that recreated the page (and e.g. might have a timestamp from a while ago/one from before the import actually occurred).

I agree, and was just thinking through this. What do you think about the edit which logs the import (the one by Admin in the description screenshot) being tagged with Recreated? That would enable it to be discoverable in RecentChanges, I believe.

Samwalton9-WMF renamed this task from Importing a page to a title that has previously been deleted results in the first imported edit being tagged with 'Recreated' to Importing a page to a title that has previously been deleted should tag the import edit with Recreated, not the first imported edit.Feb 10 2025, 1:06 PM
Samwalton9-WMF updated the task description. (Show Details)
Samwalton9-WMF updated the task description. (Show Details)

Whether or not an edit that imports a page to a previously-deleted title should be tagged as 'Recreated' is probably able to be debated; however, imo, tagging the first imported edit as 'Recreated' seems like a bug because this edit will not have been the one that recreated the page (and e.g. might have a timestamp from a while ago/one from before the import actually occurred).

I agree, and was just thinking through this. What do you think about the edit which logs the import (the one by Admin in the description screenshot) being tagged with Recreated? That would enable it to be discoverable in RecentChanges, I believe.

Received a couple of opinions on Discord agreeing with this idea - we should tag the edit denoting the import with Recreated, and not the first imported edit.

I agree, and was just thinking through this. What do you think about the edit which logs the import (the one by Admin in the description screenshot) being tagged with Recreated? That would enable it to be discoverable in RecentChanges, I believe.

On the face of it, that would make more sense to me. If a page has been deleted (and so no longer exists), importing revisions to that title would cause a page to exist at that title again, and the null edit logging the import could therefore be said to be responsible for recreating that page. I believe that this would also result in the importation log entry receiving the mw-recreated tag, which (IIUC) would therefore allow importations that recreate a page to be discoverable in Special:RecentChanges (so long as log-events aren't excluded in an end user's RecentChanges filters). In addition, to my knowledge, this tagging of the import log entry would match the current behaviour that occurs with the page creation log for non-import recreations.

However, I'm not personally certain on what the expected behaviour should be here. MediaWiki-Core-Snapshots is currently listed as unstewarded on Developers/Maintainers, so unfortunately it doesn't seem like there's a team stewarding import functionality that can be asked for their opinion about this. Having said that, though, if you're okay to go ahead with the proposed behaviour based on the feedback you've received, I haven't got any issues with that :)

Apologies for not replying earlier - I intended to, but got unintentionally pulled away by other things!

Noting that this affects files imported to Wikimedia Commons using Move-Files-To-Commons (where the destination file name has previously been deleted) - at some quick calculations (using the RecentChanges API to fetch a list of FileImporter imports in the last week, then filtering down to pages that have their first revision tagged with mw-recreated), I believe that ~14 out of 752 imports made using FileImporter in the last week (P73435) appear to have been affected by this bug.