Community Wishlist Survey 2017/Miscellaneous/Stop ifexist checks from appearing in Special:WhatLinksHere

From Meta, a Wikimedia project coordination wiki
Jump to navigation Jump to search
Random proposal ►

◄ Back to Miscellaneous


  • Problem:

#ifexist is a very useful tool - it lets you check if a page exists in template logic. However, doing the check also makes a link appear in Special:WhatLinksHere for the page whose existence was checked - and that causes problems for Wikimedians who are checking links to disambiguation pages, as there's no way to stop the link from appearing. This is part of a wider issue, as doing the same check in Lua also causes this problem.

  • Who would benefit:

People writing template code who want to use #ifexist to provide extra functionality, but can't. People doing disambiguation checking while people are using #ifexist statements.

  • Proposed solution:

Either stop #ifexist from creating a link in Special:WhatLinksHere, or create a new magic word that does the same as #ifexist without creating the link.

  • More comments:

This is a long-running problem: phabricator:T14019 was filed in 2007! It was also included in the 2015 Community Wishlist. I came across this more recently, when trying to use #ifexist to check for location redirects in Wikidata infoboxes, which caused problems e.g. see en:Wikipedia:Village_pump_(technical)/Archive_158#Wikidata_problem and is having to be manually worked around. It also caused problems at en:Template_talk:Infobox_journal#Links_to_DAB_pages with redirects to journal titles.

  • Phabricator tickets:

phabricator:T14019

Discussion[edit]

What's the use case that causes an ifexist check for a disambiguation page? How widespread is this issue? Max Semenik (talk) 21:40, 18 November 2017 (UTC)

@MaxSem: See the links I posted above. As an example of the case that introduced me to this issue, see en:Telescope Array Project - in the infobox, the desired wikilink for the location is to en:Millard County, Utah, however from Wikidata all I can fetch is en:Millard County, en:Utah (or the same text without wikilinks) - I can then find the desired link by checking {{#ifexist:Millard County, Utah}} and I can then use that link - however that exact same code used at en:Great Melbourne Telescope will be {{#ifexist:Victoria}}, which finds a link to en:Victoria, which is a disambiguation page. This then causes the problem described at [1]. This issue is a fundamental one that means that we can't use ifexist like this, which is a real shame. And, again, this was first reported way back in 2007 in other situations! Thanks. Mike Peel (talk) 21:58, 18 November 2017 (UTC)
In this particular case, it sounds like you should use the interwiki link from WD instead of trying to construct the county name by hand. Max Semenik (talk) 22:47, 18 November 2017 (UTC)
@MaxSem: @Nikkimaria objects to using "Millard County, Utah" rather than "Millard County, Utah" per en:WP:MOS, so I'll let them argue the case for that here. But regardless of that, #ifexist should be something that is *usable* by template developers rather than something that causes unnecessary problems. Thanks. Mike Peel (talk) 23:02, 18 November 2017 (UTC)
Probably the best way to solve that would be for the system to get the wikilink of the claim instead of ifexist (i.e. propertyX.wikipedia.en."Millard County, Utah" or whatever in Lua). Both are expensive functions anyway, so it's not like you would be trading performance. --Izno (talk) 04:38, 19 November 2017 (UTC)
I wouldn't narrow this just to disambiguation pages. I know about many usages where {{#ifexist:}} has been used for purpose of intentional not linking the non-existent pages, but linking if they exist (in other words blue link or plain text (instead of red link)). This is typically used in two cases: 1) when the page has been deleted and you don't want it to be re-created, 2) you have different mechanism to link to non-existent page, typically something like {{#ifexist:Page|[[Page]]|[{{fullurl:Page|action=edit&editintro=info&preload=template}} Create the Page]}} (mind that non-existent pages linked via the latter construction are not part of Special:WantedPages).
Danny B. 23:21, 18 November 2017 (UTC)

This problem is widespread in ruwiki where there are modules/templates that automatically check the existense of various pages (and link there if they exist). Instruments for checking unexistent linked pages (e.g. Special:WantedPages, tools that update wikiproject pages, like this one, relying on red links) fail when they come across pages that are checked by #ifexist (user complaints, in Russian). Jack who built the house (talk) 08:31, 19 November 2017 (UTC)

Maybe do not simply filter those ifexist links out of the result, but allow to filter them in or out. → «« Man77 »» [de] 14:11, 2 December 2017 (UTC)

Scribunto[edit]

It should be also noted, that Scribunto functions of title library which work with non-existent pages, also produce a record on Special:WantedPages. So preferably the behavior should be consistent in both cases of Scribunto and wikitext.
Danny B. 23:28, 18 November 2017 (UTC)

Scribunto doesn't do anything differently. I suspect you're mistaken about #ifexists not showing on Special:WantedPages. Anomie (talk) 00:42, 20 November 2017 (UTC)
I just checked it. #ifexists does indeed result in an entry on Special:WantedPages. Anomie (talk) 15:52, 11 December 2017 (UTC)

Why this happens[edit]

MediaWiki needs some way to know which pages need to be updated when a page is created or deleted. Usually this is because of a wikilink, so it can be turned from red to blue or vice versa, but it has to happen for things like #ifexist too. If someone were to implement this request, it would require either a new field to record the "kind" of link or a whole new table. Anomie (talk) 00:42, 20 November 2017 (UTC)

Voting[edit]

  • Support Support Tim Landscheidt (talk) 01:41, 28 November 2017 (UTC)
  • Support Support β16 - (talk) 11:22, 28 November 2017 (UTC)
  • Support Support --Liuxinyu970226 (talk) 13:11, 28 November 2017 (UTC)
  • Support Support (as proposer) Mike Peel (talk) 18:09, 28 November 2017 (UTC)
  • Support Support Thomas Obermair 4 (talk) 22:02, 28 November 2017 (UTC)
  • Support Support Wbm1058 (talk) 22:40, 28 November 2017 (UTC)
  • Support Support IKhitron (talk) 23:09, 28 November 2017 (UTC)
  • Support Support Dominic Z. (talk) 16:48, 30 November 2017 (UTC)
  • Support Support Ninovolador (talk) 22:00, 30 November 2017 (UTC)
  • Support Support«« Man77 »» [de] 14:11, 2 December 2017 (UTC)
  • Support Support Galobtter (talk) 12:39, 3 December 2017 (UTC)
  • Support Support enL3X1 ¡‹delayed reaction›¡ 15:49, 3 December 2017 (UTC)
  • Support Support LikeLifer (talk) 18:35, 3 December 2017 (UTC)
  • Support Support Joalpe (talk) 17:57, 7 December 2017 (UTC)
  • Support Support Metrónomo-Goldwyn-Mayer 02:14, 8 December 2017 (UTC)
  • Support Support Jack who built the house (talk) 20:44, 8 December 2017 (UTC)
  • Support Support Serhio Magpie (talk) 20:44, 8 December 2017 (UTC)
  • Support Support MBH (talk) 00:39, 9 December 2017 (UTC)
  • Support Supportputnik 13:30, 9 December 2017 (UTC)
  • Support Support 91.79 (talk) 20:36, 9 December 2017 (UTC)
  • Support Support Kaganer (talk) 22:45, 9 December 2017 (UTC)
  • Support Support stjn[ru] 21:34, 10 December 2017 (UTC)
  • Oppose Oppose Seems to be the correct behaviour — Jeblad 00:09, 11 December 2017 (UTC)
  • Support SupportVort (talk) 05:51, 11 December 2017 (UTC)
  • Support Support — Luchesar • T/C 13:59, 11 December 2017 (UTC)
  • Support Support On the one hand, ifexist shouldn't mark pages as wanted ones, and this problem really should be solved — that's why I support the proposal. On the other hand, server should clear page cache after creating or deleting page. Facenapalm (talk) 17:33, 11 December 2017 (UTC)
  • Support SupportNickK (talk) 17:36, 11 December 2017 (UTC)