Template talk:R avoided double redirect

Page contents not supported in other languages.
Source: Wikipedia, the free encyclopedia.

This rcat

To editor

Redr}} template to do what this template does, but this is far better. Just want to thank you very much for an excellent template! – Paine  00:33, 29 June 2015 (UTC)[reply
]

Cat recently removed

To editor SiBr4: wondered why the "updated redirects" cat was removed, since it is standard practice to place rcats at the TOP of all the categories they populate. Painius  02:54, 9 September 2015 (UTC)[reply]

Sorry, I assumed the cat was something I'd added myself when I created the template. I had added PAGESINCAT-based category counts for some maintenance/tracking categories to my sandbox yesterday, and was removing meta pages from the cats. I'll just do this instead. SiBr4 (talk) 18:58, 9 September 2015 (UTC)[reply]
I still learn something new everyday! Joys! Painius  22:07, 9 September 2015 (UTC)[reply]

Display in previews?

I think every time I've tried previewing a page with this template, I get an error message that the other page isn't a redirect. Invariably it is, and the template functions fine when I save. What's causing this? --BDD (talk) 21:50, 28 January 2016 (UTC)[reply]

The template never gives an error saying the other page isn't a redirect; if that is the case, it assumes the other page has been turned into an article and returns the message "Since page is now a separate article, please update this redirect's target" (unless the page with the template already redirects directly to the other page, which does give an error). Which of the error messages in the
Robert Finicum when you previewed the template? SiBr4 (talk) 23:19, 28 January 2016 (UTC)[reply
]
Thanks for the response, SiBr4. (I must not've watched the page because I assumed there wouldn't be one!) Yes, I think that's where it happened to me. To test it again, I replaced my sandbox with #REDIRECT [[Occupation of the Malheur National Wildlife Refuge#People involved]] {{R avoided double redirect|LaVoy Finicum}} and got the error message Error in Module:R avoided double redirect: This page is not a redirect. I'm reasonably certain that's the same message I saw before, and on several other occasions. Is the problem that "This page", i.e. the one I'm editing, isn't a redirect yet? That would explain it, but still means previewing this template is essentially useless. --BDD (talk) 16:50, 8 February 2016 (UTC)[reply]
Yes. Some magic words/Lua functions always use the saved version of a page, and don't reflect the changes you're previewing. I could look into ways for the module to know whether it's in preview mode and avoid certain errors if it is, but that could introduce the opposite problem (the template working fine in preview, but giving an error when saved). SiBr4 (talk) 17:11, 8 February 2016 (UTC)[reply]
If I may say so, I've run into this with other templates, most recently with the {{
Old rfd}} template to note the decision, so I add that and the Talk page of redirect to the talk page. On preview, it gives an error message because the talk page is still a redirect; then when the page is saved, the talk page is no longer a redirect and the error disappears. Whenever a template is designed to sense what a page is and the page is being changed by an edit, and the template is also designed to give an error under certain conditions, then that error will be seen until the page is actually changed (saved). Just SOP with some templates.  Be prosperous! Paine  15:33, 9 February 2016 (UTC)[reply
]
PS. I've noted this in the Talk page of redirect documentation, so maybe that is all that is needed here? PS added by  Paine  
Ok, this just worked as intended with a preview. If someone fixed something, thanks. For reference, I was previewing Foliage-gleaner
Furnariini, and I just created the latter (I created it before tagging the former). --BDD (talk) 21:29, 11 February 2016 (UTC)[reply
]

Foliage-gleaner, there wasn't an error because the page was already a redirect before the addition of the template.

I just made this edit, which prevents an incorrect "not a redirect" error when creating a new redirect (though not when turning an existing non-redirect into a redirect). It's probably technically impossible to get the redirect data of the actual previewed version, so any such edits to prevent false-positive errors will create false negatives as I mentioned above. A note in the template documentation about the potential unreliability of the template in preview mode would help in any case (re. Paine). SiBr4 (talk) 23:34, 11 February 2016 (UTC)[reply

]

Transclusion when at RfD

This module fails with the message "page is not a redirect" when it is transcluded into a page that is marked for discussion at RfD (when indeed it is not a redirect). Si Trew (talk) 03:10, 26 March 2016 (UTC)[reply]

@Si: As you noted, that conclusion is technically correct. There is no simple way for the module to automatically determine if a page is an RfD-ed redirect, short of getting the page contents to search for the RfD template (then again, the same thing is already done to find the redirect target in Module:Redirect).

The error could be hackily avoided by setting either |thistarget=target article or |noerror=1. Both are, however, intended for demonstration of the template, and hence prevent categorization into the three Radr categories. If useful a similar parameter for use in mainspace could be added to the module. SiBr4 (talk) 22:06, 26 March 2016 (UTC)[reply]

@
rfd}} passes, but since that template is SUBST I am not sure how that would work - it would probably require another level of indirection. Si Trew (talk) 04:53, 17 December 2016 (UTC)[reply
]
No other template in Category:Redirect templates seems to suffer from this problem. Si Trew (talk) 22:37, 26 March 2016 (UTC)[reply]
Few other templates contain any conditional logic to give errors if used on non-redirects. For this template, the criteria for use are relatively strict, and some conditional output is essential, as the message and categories need to change when the other page is no longer a redirect. It was therefore easy to add error checks, though one might question their necessity. SiBr4 (talk) 11:18, 27 March 2016 (UTC)[reply]
Was about to start a section about this myself, then noticed there already was one. I just brought myself over to this talk page because of the same error I noticed, where the module doesn’t seem to play nicely during an RfD discussion. Not sure if it’s an error worth fixing though (?). ]

Rfc - add boldface to redirect page name

The template should display the link of the alternative title in boldface. It's an important information and otherwise easily overlooked when several other templates are on the page. Rfassbind – talk

 DoneTo editor
Temporal Sunshine Paine  12:29, 11 August 2016 (UTC)[reply
]

CAT:AVOID2RUPDATE
issue

@

Baron Trump and Making televsion) by applying {{Redirect category shell}} (after some lengthy pondering on potential fixes). I'm not sure why that fixes it, or what is causing what appears to be a problem. — Godsy (TALKCONT) 06:53, 5 February 2017 (UTC)[reply
]

Curiouser and curiouser! Man, I completely missed this one for some reason. Godsy, the cat is empty right now, so I've put it on my daily watch to see if it happens again and to make updates when needed.  Paine Ellsworth  put'r there  14:12, 12 March 2017 (UTC)[reply]

Additional text

Reference Pal Hermann

Pál Hermann, will become an article by way of a page move. There was a recent Requested move on the target's talk page, Talk:Paul Hermann (composer)#Move review request 1 February 2018, that shows this is possible. I added text to Module:R avoided double redirect to fill that need. Happy Publishing!  Paine Ellsworth  put'r there  19:43, 18 February 2018 (UTC)[reply
]

Template-protected edit request on 6 March 2020

Please sync:

Changes:

SD0001 (talk) 10:06, 6 March 2020 (UTC)[reply]

To editors ]
If I understand you correctly, your issue is with {{#ifeq:{{FULLPAGENAME}}|Wikipedia:Template messages/Redirect pages to be changed to {{#ifeq:{{FULLPAGENAME}}|Wikipedia:Template index/Redirect pages? If that was what you wanted, that has nothing to do with the issue above. Also, as I pointed out in linked discussion, a better solution would be to add a |doc= parameter. While it requires a parameter, it's much more flexible in allowing other pages to use it and does not require changing code in tons of templates anytime a page name changes. --Gonnym (talk) 19:14, 6 March 2020 (UTC)[reply]
Okay, so if we make that change and bypass the redirect in addition to this fix, it won't matter, I get that. But why exactly would we want to bastardize the ifeq function with an if function that does exactly the same thing? How does that fix anything? ]
The if parser function does not do the same thing as the if template. One strips white spaces, the other doesn't. One has a visual bug, while the other doesn't. For a more complete breakdown of the issue, see the discussion, as there isn't any real point to repeat it here. --Gonnym (talk) 21:55, 6 March 2020 (UTC)[reply]
That makes good sense, ]
]
Yes, you are correct, however (and I'm sorry I mixed up the terminology above), we are replacing "#ifeq" (and not "#if") with {{If|eq}}. Thank you for asking that though, as it seems the "eq" part was removed by accident. --Gonnym (talk) 08:35, 7 March 2020 (UTC)[reply]
@Paine Ellsworth: ok, I think I've created a working version with the |doc= parameter. If doc= is used, the template does not appear. Please see if I missed anything. --Gonnym (talk) 09:00, 7 March 2020 (UTC)[reply]
To editor ]
That just requires either a change to this template or to Template:Tlrow. I added a default |doc=yes parameter to Template:Tlrow/sandbox as that template is always used for documentation, so no need to even use an extra parameter. --Gonnym (talk) 14:49, 7 March 2020 (UTC)[reply]
I removed the exception code from {{]
You can't remove that part. You might have misunderstood me. If you are using {{Tlrow/sandbox}} to show the template, you don't need to do {{Tlrow/sandbox|R avoided double redirect/sandbox|doc=yes}} (which won't work anyways), as the template will handle the |doc=yes part by itself. Try this again, with restoring the code you removed. --Gonnym (talk) 16:27, 7 March 2020 (UTC)[reply]
Okay, I see it now. And yes, I misunderstood you to mean that if the |doc= parameter was used in the {{]
If there are no other concerns, then this can be done. I'll wait the day and see if someone adds anything to this discussion. --Gonnym (talk) 07:00, 8 March 2020 (UTC)[reply]
Updated all 3 pages. --Gonnym (talk) 08:02, 11 March 2020 (UTC)[reply]

Namespace

"Use this rcat template on mainspace redirects only."

Why shouldn't this template be used in other namespaces, and do we need another template for other namespaces if there is any good reasons why this one shouldn't be used?

]

What useful purpose does this template serve? What is the good reason why it should be used in other namespaces? Frankly I don't see a useful purpose for this in any namespace. This template causes more trouble than it's worth. wbm1058 (talk) 01:31, 24 June 2020 (UTC)[reply]
The purpose is to help people find redirects that need to be updated because they were bypassing a double redirect that has been changed. It does seem to raise a few too many errors at the moment, though, and particularly I see no reason to restrict it to mainspace only. Anomie 03:24, 24 June 2020 (UTC)[reply]
Here's a screenshot of one I found in Category:Avoided double redirects to be updated. It's telling me to make an intentional redirect to the disambiguation page Kill Yourself. At least that page tells me that "Kill Yourself" is a song by Joji (musician), which is more than the bio on the musician tells me. What the heck am I supposed to do with this. It's a damn waste of time. The redirect should just be deleted, rather than managed with time-wasting templates. If I has to work with this for long it might make me want to kill myself, ha! wbm1058 (talk) 04:12, 24 June 2020 (UTC)[reply]
No-one forced you to work with this at all; its your choice if you decide not to nominate it for deletion, if that's your wish. Other people find this helpful; It helps us to see which redirects need looking at without having to search through every one of them. ]
You are forcing me to search through hundreds of false-positive {{error}}s to find the handful that actually need fixing. wbm1058 (talk) 11:26, 24 June 2020 (UTC)[reply]
No-one forced you to do anything. We do appreciate it if we have a smaller selection of false positives to look through than if we had to look through every single redirect. But no-one's forced to do anything. ]
There are three SpongeBob SquarePants pages in Category:Avoided double redirects to be updated at the moment. SpongeBob is an annoying ploague on the 'pedia, IMO. Clean it up. wbm1058 (talk) 11:32, 24 June 2020 (UTC)[reply]

OK, right. No one is forcing me to do anything. Nobody is forced to revert vandalism, nobody is forced to care. Alas, nobody can force anybody else to do anything either, so if ya really want something to get done sometimes ya gotta do it yourself. I just realized that I've been around Wikipedia longer than this template has; this template has kind of snuck up on me. Its function is so far down on my to-do list of priorities that if it were up to me to implement this it would never get done. But I realize we all don't have the same priorities. I would be content if this template went about its business without bothering me, but, it hasn't done that (sorry), so here I am.
Template:R avoided double redirect and Module:R avoided double redirect were both created on 3 April 2015‎ by SiBr4. Was this just boldly done, or was there any discussion prior to its implementation? Was there any discussion about what namespace(s) it should support? It's never been a stand-alone template; the template has always been a shell around the module which does most of the work. After some digging, I've found that Template:Incorrect redirect template puts out that orange stop hand that's causing all the trouble. That template, in turn, is called by Module:Redirect template. Module:R avoided double redirect returns via:

 return frame:expandTemplate({title="Redirect template",
                              args={from=from,info=info,["main category"]=cat,
                                    name="From an avoided double redirect"}})

which is equivalent to {{Redirect template|main category=Avoided double redirects}}
The others could populate another, new category with the equivalent of: {{Redirect template|main category=Avoided double redirects|other category=Other avoided double redirects}}
but I'm not fluent enough in Lua to immediately know the syntax for coding that change in the module. – wbm1058 (talk) 19:30, 24 June 2020 (UTC)[reply]

Was this just boldly done, or was there any discussion prior to its implementation?
The
Chihiro (Spirited Away)
; its many current uses are the work of other editors who presumably consider it to be useful on those pages.
It's telling me to make an intentional redirect to the disambiguation page Kill Yourself.
It was originally added in April 2019, when "Kill Yourself" was still a redirect to the artist's discography. Its purpose was to monitor that page, so that when an article on the song would be written there, the redirect "Kill Yourself (Pink Guy)" is marked for updating, as it would need to point to the new song article instead. For all the template knows, "Kill Yourself" is now no longer a redirect, so it does its job and suggests retargeting the redirect there.
The template can't be sure that the specified ex-redirect is actually the correct target, although the message can (and probably should) be changed to not be as confident that it is, as Anomie's proposed edit nicely does. I've removed the template from Kill Yourself (Pink Guy)
Kill Yourself (Pink Guy), though alternatively its parameter could just be changed to a different possible name for an article on the song. SiBr4 (talk) 20:51, 25 June 2020 (UTC)[reply
]
Thanks. Sorry that my tone above generated some excess heat. I've cleared out Category:Avoided double redirects to be updated and Category:Avoided double redirects/error (except for two "sticky" items) to familiarize myself with how this process works and check out the sandbox version with some live cases. – wbm1058 (talk) 22:08, 25 June 2020 (UTC)[reply]
Thanks a lot for that – fairly big category to clear out single-handedly in one go. Sorry if I was a bit short with you earlier, I know that sometimes it does get a bit confusing with errors that (to humans) seem obviously not a problem. Thanks, WT79 (speak to me | editing patterns | what I been doing) 08:39, 9 July 2020 (UTC)[reply]

Restart

The above has gotten a bit too heated for my taste. I've rewritten Module:R avoided double redirect/sandbox to clean up the overabundance of errors, to remove the mainspace-only restriction, and to work correctly when previewing. I also wound up revising many of the messages. You can see the results at Template:R avoided double redirect/testcases. Any objections to making that edit to the live module? Anomie 20:06, 24 June 2020 (UTC)[reply]

@]
I was thinking of "its target article is changed" referring to the redirect's target being changed. Anomie 22:53, 24 June 2020 (UTC)[reply]
OK, that sounds more plausible. Perhaps 'or it is retargeted' might prevent further confusion? ]
Sure, done. Anomie 15:40, 25 June 2020 (UTC)[reply]

Anomie's version is now live. Thanks, wbm1058 (talk) 22:08, 25 June 2020 (UTC)[reply]

Template-protected edit request on 8 July 2020

Please add {{template shortcut|R avoid 2R}} to the top of the page, just inside the <noinclude> tag. This can be seen at Template:R avoided double redirect/sandbox (sandbox version is identical apart from above shortcut and that it uses {{#invoke:R avoided double redirect/sandbox}} instead of {{#invoke:R avoided double redirect}} – beware of this if you simply copy across code from sandbox). Thanks, WT79 (speak to me | editing patterns | what I been doing) 16:28, 8 July 2020 (UTC)[reply]

 Done Izno (talk) 14:29, 9 July 2020 (UTC)[reply]

Problems with the template

In the more frequent usage of this template outside of testcases, a couple of errors have come to my attention:

  • When creating a page, the template displays the 'this page is not a redirect' message on preview. The cause of this is fairly clear (although I haven't looked at the module): if a page does not exist (apart from in someone's unpublished browser window), it cannot have any target, according to its (non-existent) metadata. Not quite sure how to fix this; in wikitext I'd use the {{#IFEXIST}}
    magic word
    , but I don't know enough Lua to do this in the Module. Presumably the 'not the same target' error message would also need to be changed for the same reasons, not sure about the rest, they aren't so obvious.
  • In this template's page, it is displaying the 'broken redirect' error. Not sure how to make the template stop this, but the current method isn't working.

Sorry if that all sounds like a moan, a lot of hard work has gone into this template and it is almost always works very well – but still isn't perfect. WT79 (speak to me | editing patterns | what I been doing) 08:36, 9 July 2020 (UTC)[reply]

I cannot reproduce your first bullet. If I go to a title that does not exist and enter the wikitext
#REDIRECT [[Foobar]]
{{r avoided double redirect|Foo}}
and click "Preview", it displays as if the page had been saved with that content. If you're using mw:Manual:Live preview or some gadget/script to do previews instead, it may be a bug in that. Anomie 13:30, 9 July 2020 (UTC)[reply]
Yes, I am using the live preview. It works fine if I turn it off – thanks, WT79 (speak to me | editing patterns | what I been doing) 21:52, 9 July 2020 (UTC)[reply]
As for the sample display at the top of Template:R avoided double redirect, now I finally see what exactly the |noerror= was for. Fixed. Anomie 13:45, 9 July 2020 (UTC)[reply]

Counted as a transclusion

I noticed that redirect pages with this template are marked as (redirect page; transclusion), instead of just (redirect page). An example is

Francais; the mark can be seen here at Pages that link to "French language". Is this intended? — Goszei (talk) 05:21, 31 January 2021 (UTC)[reply
]

It's a side effect of the logic that tests whether the avoided redirect got changed, which would mean the tagged redirect would need updating. The "content" of the avoided redirect gets read, which counts as a transclusion. Anomie 18:51, 31 January 2021 (UTC)[reply]

Edit request: missing colons

Three instances of links, split amongst lines 109, 122, and 130, do not have colons before their links, unlike all the other instances before it. This affects File:SNES Ogre Battle - The March of the Black Queen (Densetsu no Ōga Batoru) - Battle Screen.png. To fix it, just go to those lines and add the colon so it looks like lines 103 and 113: [[" to [[:" -BRAINULATOR9 (TALK) 14:34, 8 July 2021 (UTC)[reply]

 Done — Martin (MSGJ · talk) 21:41, 8 July 2021 (UTC)[reply]

Template-protected edit request on 7 April 2023

I would like to sync this template's module with my revision of its sandbox (permalink, diff). I've slightly simplified the logic of the module (by replacing if a then else with if not a then), as well as making it a tad more clear by using elseif in the errors block (which is possible because all of the if statements are guaranteed to return the function). The sandbox version produces the same result as the main version in all of the /testcases. {{Lemondoge|Talk|Contributions}} 23:28, 7 April 2023 (UTC)[reply]

 Completed. ]

 You are invited to join the discussion at Wikipedia:Village pump (proposals) § Explicitly allow A2R to tag redirects that are related topics with another redirect. Aaron Liu (talk) 17:39, 5 January 2024 (UTC)[reply]

Edit request 6 January 2024

This is a redirect from an alternative title for (redirect page name), another redirect to the same title.
+
This is a redirect from an alternative title or related topic of (redirect page name), another redirect to the same article.

See the discussion above, for which it seems like there's consensus. Aaron Liu (talk) 13:32, 6 January 2024 (UTC)[reply]

]
Ah, didn't realize that. Sounds good! Aaron Liu (talk) 16:25, 6 January 2024 (UTC)[reply]

Display error

There's a display error using this template at Linewaiter's Gazette

Linewaiter's Gazette, which I think is caused by the apostrophe, as it displays properly without it. Would anyone care to address? Sdkbtalk 18:27, 13 June 2024 (UTC)[reply
]

This throws an error message on pages nominated for RfD

This module throws an error message, This page is not a redirect., when the page contains a RfD nomination header. The module should check for such, and not throw an error when a redirect has been nominated for RfD, as it confused editors, other Rcat template do not throw this error when a redirect has been nominated for RfD.

-- 64.229.88.34 (talk) 03:59, 10 September 2024 (UTC)[reply]

 Not done: the error is actually true, that is, the nominated page is "not (truly) a redirect" and won't be a true redirect again until it survives RfD and the nomination header is removed. ]
While the error is temporarily true, I hope it doesn't result in people removing the template to "fix" the error and then not re-adding it if the RFD closes as "keep". Anomie 11:26, 10 September 2024 (UTC)[reply]
Maybe I've made it a little better? The error now reads, This page is not a functioning redirect – possibly disabled by RfD. ]

Edit request 7 October 2024

Description of suggested change:

Diff:

ORIGINAL_TEXT
+
CHANGED_TEXT

180.129.63.46 (talk) 16:53, 7 October 2024 (UTC)[reply]

 Not done: it's not clear what changes you want to be made. Please mention the specific changes in a
"change X to Y" format and provide a reliable source if appropriate. --Ahecht (TALK
PAGE
)
16:59, 7 October 2024 (UTC)[reply
]

Error message

Getting Error in Module:R avoided double redirect: This page is not a functioning redirect – possibly disabled by RfD. for target

]

Found the problem. Typo in the redirect target. Fixed. Error message was red herring. Cheers, · · · Peter Southwood (talk): 07:41, 13 October 2024 (UTC)[reply]

Hello,

It looks like backlinks are not added by this template. Is there any reason why this isn't done? I know this is due to a plainklinked external URL which doesn't add backlinks, in order to add redirect=no to the URL. I'm not sure what the best way to work around this would be, as I only know of using the parser function #ifexists to force a backlink without a visual display.

My use case of this is to find the avoided double redirects to a given page, though there are potentially other ways to do this (though ideally I wouldn't make full text searches).

Thoughts? ~ Eejit43 (talk) 23:56, 23 June 2025 (UTC)[reply]

Thanks to AntiCompositeNumber via Discord, I've learned that #ifexists no longer produces a backlink, following T14019. Is anyone aware of a workaround to this issue? It would be very helpful to have this reintroduced. ~ Eejit43 (talk) 00:05, 24 June 2025 (UTC)[reply]

Edit request 26 June 2025

In regards to the above section, please make the following change to Module:R avoided double redirect to add back backlinks to the intended target. This probably isn't the most elegant solution, but it should work just fine.

Line 3: Line 3:
local function noredir(page) local function noredir(page)
local link = page:fullUrl("redirect=no") local link = page:fullUrl("redirect=no")
return "<span class=\"plainlinks\">[" .. link .. " " .. page.fullText .. "]</span>" return "<span class=\"plainlinks\">[" .. link .. " " .. page.fullText .. "]</span><span style=\"display: none\">[[" .. page.fullText .. "]]</span>"
end end

~ Eejit43 (talk) 02:14, 26 June 2025 (UTC)[reply]

To editor ]
@Paine Ellsworth yes. Originally I hadn't actually tested the functionality via the sandbox, but I have now and it behaves as expected. ~ Eejit43 (talk) 03:38, 26 June 2025 (UTC)[reply]
I see where you have edited the module's sandbox. Can you link to the exact test results, please? ]
@Paine Ellsworth I apologize, my communication was sub-par yesterday. I originally tested just the markup portion on my sandbox, and then validated that correct code was returned via the console in edit mode of the module.
Anyhow, I've added a new example to the testcases, and you can see via Special:WhatLinksHere that the test case properly links to B2, despite the visible link being a plainlinked external URL. ~ Eejit43 (talk) 13:15, 26 June 2025 (UTC)[reply]
Awesome, and  completed. ]
Also they should probably make T395366 happen. Anomie 17:06, 26 June 2025 (UTC)[reply]
@Paine Ellsworth would you mind making a quick change and appending a colon to the inside of the link? I doubt there are any cases of this (especially as normal category redirects aren't allowed), but if categories or files are passed this won't function properly. Thank you! :) ~ Eejit43 (talk) 00:12, 27 June 2025 (UTC)[reply]
 Completed. ]