Page MenuHomePhabricator

Show a warning on creating double redirect
Open, MediumPublicBUG REPORT

Authored By
Bugreporter2
Jan 1 2023, 12:37 PM
Referenced Files
F57725973: image.png
Wed, Nov 20, 8:17 PM
F57722292: image.png
Tue, Nov 19, 9:43 PM
F57719561: 20241119_092316.png
Tue, Nov 19, 8:27 AM
Tokens
"Hungry Hippo" token, awarded by Bugreporter2."Like" token, awarded by Pppery.

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.):

Related Objects

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)