Page MenuHomePhabricator

Show a warning on creating double redirect
Closed, ResolvedPublicBUG REPORT

Description

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

  • Create a new redirect to an already existing redirect.

What happens?:

MediaWiki allows you to make a double redirect like this, no worries. On WMF wikis, a bot comes along and fixes the mess, but not all wikis have these bots.

What should have happened instead?:

An error message should appear, similar to MediaWiki:Selfredirect, but specifically for this problem (creating a double redirect). This should advise the user to change the redirect target to the target of the second redirect.

Note that there is a check for self-redirects at this point. This is analogous.

Software version (skip for WMF-hosted wikis like Wikipedia): 1.35

Other information (browser name/version, screenshots, etc.):

Details

Event Timeline

Reedy renamed this task from No warning on creating double redirect. to No warning on creating double redirect.Jan 1 2023, 8:22 PM
Aklapper renamed this task from No warning on creating double redirect to Show a warning on creating double redirect.Jan 10 2023, 9:33 PM
Bugreporter2 added a project: patch-welcome.

Change #1090544 had a related patch set uploaded (by SomeRandomDeveloper; author: SomeRandomDeveloper):

[mediawiki/core@master] Add a warning when trying to create a double redirect

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

Would it be possible with this to specify, in the error message, the target of the redirect you're attempting to redirect to? The chances are that's what the redirect target should be as well.

Would it be possible with this to specify, in the error message, the target of the redirect you're attempting to redirect to? The chances are that's what the redirect target should be as well.

I actually had that in mind and forgot about it again. I could implement this with toEditContent but I'm not sure what the performance impact of that is.

20241119_092316.png (110×761 px, 29 KB)

Getting the optimal wording for error messages can be tricky: https://uxwritinghub.com/error-message-examples/

I'd go with something like:

You are trying to redirect this page to a second redirect page, creating a double redirect.  Your target page currently redirects to [[{{{1}}}]].  Please consider revising your target page as follows:
 
<code><nowiki>#REDIRECT[[</nowiki>{{{1}}}]]</code>

Note: if you submit the original information again, the double redirect will be created anyway.

Thanks for the feedback, I was mainly trying to keep it consistent with the other warning messages. After thinking about it again, that didn't really work for conveying more information than just the reason for why it went wrong.

I adjusted the message to what you suggested with a few minor changes, such as displaying the button label like before:

image.png (175×922 px, 30 KB)

Latest version of the message (PS 17):

image.png (236×980 px, 29 KB)

I'm confused. What's teh next step? It's in "code for review," but nobody seems to be reviewing it. Does @matmarex need to review again?

Change #1090544 merged by jenkins-bot:

[mediawiki/core@master] Add a warning when trying to create a double redirect

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

Yes, I've just been busy with other things. Reviewed and approved now :)

Sure, no worries. Thanks @matmarex - I genuinely appreciate your work.

Yes, I've just been busy with other things. Reviewed and approved now :)

Thanks for merging :)
It's rather on me that it took so long since I did not have a lot of time for a few weeks after you reviewed the changeset so I only responded to it 5 days ago.

For the Tech News entry, please confirm if this is comprehensible and accurate. (I've been staring at / rewriting the phrasing for too long, and the words are losing meaning!) Thanks.

Later this week, there will be a new warning for editors if they attempt to create a redirect that links to another redirect (a double redirect). The feature will recommend that they link directly to the second redirect's target page. Thanks to the user SomeRandomDeveloper for this improvement. [1]

@Quiddity -- Most MW users probably know what a double redirect is.

One thing that is significant now is that wikis with $wgFixDoubleRedirects=true shouldn't get any double redirects other than ones deliberately created by users who are stupid enough to ignore the warning. I realise that assuming all users aren't stupid is a little bit dangerous, but hopefully there will be less need for tidying.

@Quiddity That wording looks good to me, thanks.

I hope I speak for at least a thousand editors when I say the two words you devs never hear enough of... thank you!