Page MenuHomePhabricator

Delete-redirect-and-move message should include the redirect's target
Open, Needs TriagePublicFeature

Description

Feature summary:

MediaWiki:Delete_redirect_and_move text says:

The destination page "[[:$1]]" already exists as a redirect.
Do you want to delete it to make way for the move?

This should specify the target of the redirect, which can be pushed as $2:

The destination page "[[:$1]]" already exists as a redirect to "[[:$2]]."
Do you want to delete it to make way for the move?

In order to do this, you're first going to have to pull the redirect target with (I think) RedirectLookup::getRedirectTarget() and then push that to the system message as $2.

Benefits:

The system message would be more informative about the redirect page's content, giving users more information that would allow them to make a better-informed decision as to whether to proceed.

This is an initial step to implementing T378456: Add custom message (similar to delete_redirect_and_move_text) when moving page over a redirect that points back to itself, but probably should be done first as (1) it's simpler (2) has a more general application and (3) the output would be useful for fixing T378456, which it might not actually need to be if this is sufficient.

Details

Event Timeline

Change #1288368 had a related patch set uploaded (by Pppery; author: Pppery):

[mediawiki/core@master] Pass redirect targets in movepage delete messages

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

I hate MediaWiki development sometimes. This is the sort of change that should have been trivial but ended up having 3 times as much code as it should have had because of all of the "latest and greatest" refactorings - services, breaking up the Title class, Phan, etc.