Page MenuHomePhabricator

[RandomSelection] Special:WhatLinksHere should detect links inside <option> tags
Open, Needs TriagePublic

Description

Example:

  • https://doomwiki.org/w/index.php?title=Special%3AWhatLinksHere&target=Soul+sphere&namespace=0&invert=1

Expected outcome:

  • [[Template:Did you know]] is included in the list of links.

Actual outcome:

  • [[Template:Did you know]] is not included in the list of links, but in its wikitext we find
<option>'''Did  you know''' that the [[soul sphere]] was originally supposed to be an  "extra life" [[item|powerup]], before the concept of lives was dropped  during [[Development of Doom|development]]?</option>

Environment:

  • MediaWiki 1.27.4
  • PHP 5.6.30-0+deb8u1 (fpm-fcgi)
  • MySQL 5.5.55-0+deb8u1
  • Extension:RandomSelection 2.2.2

Links inside <option> tags are rendered on some pageviews and not rendered on others. Special:WhatLinksHere is treating them as never rendered, which leads to incomplete maintenance tasks.

Event Timeline

<option> is not provided by MediaWiki Core. It is part of an extension installed on your wiki?

Try to use {{#tag:option|text}}, maybe that fixed the problem for the moment.

How embarrassing. Yes, it is the RandomSelection extension. Sorry about that -- somehow I remembered it as a non-standard but widely supported HTML tag.

I will test again and rewrite the description so it doesn't conflate core and non-core ideas.

@Umherirrender, thank you for that idea. It genuinely seems like it should work, but it doesn't. In fact, no options rendered at all until I made the same change to <choose>, which restored rendering but didn't affect the original issue.

Other suggested workarounds, for the record:

  • A dump scan using a bot with regexp functionality. Most projects will not have this in their collective skill set.
  • Use the CirrusSearch extension to find raw wikilink text with the insource: feature. This greatly extends the manual workflow for each list of links (e.g. following redirects). Many wikis have no individual control over extensions anyway, or (as at my home wiki) the server/bandwidth arrangement is too modest to install many extensions, especially those which merely improve a core function.
  • Turn each option into a transclusion. This actually works (RandomSelection version 2.1.5), but would be opaque and inefficient in situations where the options were single words or sentences. I have seen <choose> used, for example, to link a random administrator's talk page in a notification template, to divide up the volume of replies.

This might eventually be resolved as a special case of T35254 depending on how that is implemented.

Per these instructions, I am adding Jack Phoenix who is listed as an author on the extension page and on Special:Version, and who appears to be active.

It is recognized (by me at least) that issues with this extension are a low priority for the developer community as a whole, because it can never be used on WMF projects for performance reasons. (See here for a better explanation than I could write.)

Hope that makes some sense; thanks.

Aklapper renamed this task from Special:WhatLinksHere should detect links inside <option> tags to [RandomSelection] Special:WhatLinksHere should detect links inside <option> tags.Jan 25 2019, 6:26 PM