Template talk:TRA ridership

Bogus wikilinks from ifexist
The #ifexist check in TRA ridership is causing bogus wikilinks to disambiguation pages. For example, Special:WhatLinksHere/Dingpu Station includes Dingpu railway station. The template uses the parameter for two purposes: looking up the number of passengers (for which it requires the name in the form "Foo Station") and checking whether the page exists (why?). That #ifexist: check causes a wikilink to be recorded, which creates work for disambiguating wikignomes who try to track down the cause. We've had a go at fixing Hsinchu railway station‬ but unfortunately this removes the ridership figure.

Firstly, can we simply remove the #ifexist check? Does the template actually need to behave differently if there doesn't happen to be a page on Wikipedia with the name in the form "Foo Station" (which may be a dab page or a completely different station)? Secondly, can we just use the article name with "railway" and/or "station" removed, reserving the parameter for awkward cases like Zuoying HSR station? I've attempted to do that in TRA ridership/sandbox, which seems to work.

What do you think? Certes (talk) 20:23, 27 August 2018 (UTC)


 * I've come across this specific problem at least three times, possibly more. The most recent was the one you noted in Talk:Hsinchu railway station. After one of those futile struggles to find a useful solution, I've adopted the brutal tactic of overwriting the bad link with a link to the correct page, even if that means that the article flails around looking for something which doesn't exist within the template and so records an average daily ridership of zero.
 * I am not a template editor, and I do not understand the inner workings of templates. It is up to those editors who write this sort of template to ensure that they do not create errors. I have wasted more time than I care to remember trying to fix this type of problem. I do not care at all how such problems are solved, so long as they do not create unnecessary work for WP:DPL members.
 * Links to non-DAB pages generated by this template will, of course, be circular – i.e., they will call the page which made the #ifexist request, to check whether or not that page exists. Duh. Narky Blert (talk) 20:52, 27 August 2018 (UTC)
 * It's almost circular. The template call in article Foo railway station normally checks whether Foo Station exists.  Nine times out of ten that's a redirect back to Foo railway station, but occasionally (Dingpu, Hsinchu…) we're unlucky and it's a dab or some other irrelevant page.  The version in the sandbox aims to fix that problem, so we can have ridership figures without unwanted links. Certes (talk) 21:33, 27 August 2018 (UTC)
 * After a quick check, I think Longjing railway station is the only other page affected. I'll boldly remove the #ifexist check tomorrow if no one objects.  I don't see why the citation for a figure in Foo railway station should be conditional on its having a redirect from Foo Station. Certes (talk) 01:25, 29 August 2018 (UTC)
 * Fixed. Please revert or complain if you see any side effects. Certes (talk) 17:56, 30 August 2018 (UTC)