Feature request:
Users (either all or those with a specified new right, such as overwrite-redirect) should be able to delete a redirect page by moving a page to the redirect's title without needing to move or delete the redirect out of the way first, provided that all revisions of the target redirect page were revisions that were also redirects.
Use case:
- On wikis were bots fix double redirects, any such 'fixed' redirect can only be overwritten by first moving it out of the way using suppressredirect and then moving the desired page to its new location; instead, such redirects would be overwritten normally, allowing users without suppressredirect to make such moves
- A -> B -> C
- A -> C
- C cannot be moved to A and automatically delete the redirect
- If a redirect is created to a section of a page, and then a full page is created for the topic, it cannot be moved to the redirect without moving the redirect out of the way
- A -> B#C
- C, a new page on the subject, cannot be moved to A and automatically delete the redirect
Proposed implementation:
After Title::isSingleRevRedirect, which checks if a page has only 1 revision and is a redirect, create Title::alwaysRedirected, to check if every revision of a page has been a redirect
- Check if the current revision is a redirect; if it isn't, return false
- Select from the database revisions with the same page id but that are not redirects
- If any such revisions exist, return false; otherwise, return true
Update MovePage::isValidMoveTarget to allow moving over single revision redirects regardless of target (rather than changing the redirect target and then allowing the move, just allow the original move)
Outstanding questions:
- Should this be integrated into the current move right, where any user that can overwrite a single revision redirect currently will be able to overwrite multi-revision redirects in the future?
- ...or, should this be a separate user right, given the increased abilities and the higher number of deleted revisions
- To be investigated: what is the best way to check if a page has always been a redirect?
- The revision table does not store whether the revision was a redirect
- Manually checking each past revision to see if it was a redirect is inefficient
- Should there be a limit on the number of revisions that can be overwritten? This would simplify checking past revisions manually, and can be checked using Database::selectRowCount.
- ...Otherwise, a new revision.revision_is_redirect column may be needed ("revision_is_redirect tinyint unsigned NOT NULL default 0")