Last modified: 2014-11-17 10:35:33 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T14396, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 12396 - "what links here" should list the template, not the pages that use it
"what links here" should list the template, not the pages that use it
Status: NEW
Product: MediaWiki
Classification: Unclassified
Special pages (Other open bugs)
unspecified
All All
: Low enhancement with 3 votes (vote)
: ---
Assigned To: Nobody - You can work on this!
: schema-change
: 17728 21266 28855 (view as bug list)
Depends on:
Blocks: 21266
  Show dependency treegraph
 
Reported: 2007-12-24 05:03 UTC by Dan Clemmensen
Modified: 2014-11-17 10:35 UTC (History)
13 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description Dan Clemmensen 2007-12-24 05:03:06 UTC
When a template directly introduces a link to a target page, the "what links here" list for the target page should list the template as a link to the target, but it should not list a page that uses the template as links to the target (unless the using page also has direct links to the target.)

Alternative: Treat links generated by a template similarly to links via a redirect: that is, list the template, and then list all pages linked via the template indented under the template link.


Justification: "what links here" is used by people who move a page to find and repair all of the links to the page. We also use "what links here" to gauge the relative importance of several pages when determining whether a particular page should retain the "main title" when disambiguation is needed. A third major use of the "what links here" is to generate the list of "most needed articles." In all three cases, the resultes rae severely distorted when th epage is linked from a template. For example, a completely obscure Football coach named Clyde Snerd suddenly has 50 links when he is one of 50 football coaches listed in a template of "coaches of the Lower Smedley football club."  If I move his page to "Clyde Snerd (football coach)" I must then check all 50 pages to see if any of them have non-template references.Changiong e template first does not help, because the resulting updatea process (apparently) runs in the background and can take quite a long time.  The result on the "most wanted articles" list is dramatic: all of the topmost "most wanted" articles are due to inclusions in templates.
Comment 1 Mike.lifeguard 2008-11-25 04:09:08 UTC
I don't think this is possible with the current schema which tracks links between pages. Furthermore, I don't see the utility in changing things.
Comment 2 Alexandre Emsenhuber [IAlex] 2009-10-24 17:02:41 UTC
*** Bug 21266 has been marked as a duplicate of this bug. ***
Comment 3 Michael Hardy 2009-10-24 17:08:06 UTC
Oh, great.  The fact that there is one person somewhere who FAILS to see the utility is now considered a cogent point.

When I move an article and then click on "what links here", I sometimes see a
couple of hundred links nearly all of which result from pages using a template.
After editing the template to link to the new title, I want to see the
(usually few) links from articles themselves, rather than those resulting from
a template.  Currently the only way to do this is to wait 24 hours so that when
you view "what links here", the template links will no longer link to the old
title.  Currently one can click on "hide redirects"; there should be a similar
thing to hide links resulting from articles' use of templates.

I reported the above as a bug, and it got marked as a duplicate of this even though it proposes something DIFFERENT.
Comment 4 Alexandre Emsenhuber [IAlex] 2009-10-24 17:20:16 UTC
It's a bit different, but the problem is the same: currently templates are expanded and only after that links are parsed and replaced. To fix this, we should change parsing older to parse links in the same time as we expand templates and change the pagelinks database table to know if the link is directly inserted in the page or comes through a template. Also a problem would be parameter substitution: {{Some template|link=[[Some page]]}} or {{Link|page=Some page}} where Template:Link contains something like "[[{{{page}}}]]", for those two cases, should the link be considered as comming from the page, or the template? (first example might be easier than the second one)
Comment 5 Alexandre Emsenhuber [IAlex] 2009-10-24 17:21:21 UTC
sorry: order, not older.
Comment 6 db [inactive,noenotif] 2011-05-06 19:07:20 UTC
*** Bug 28855 has been marked as a duplicate of this bug. ***
Comment 7 Mikael Häggström 2011-05-08 07:02:22 UTC
I posted that duplicate bug, and I agree that it's the same problem as already given here.

I don't know which of the proposed solutions should be used to fix this bug, but it desperately needs to be fixed.
Comment 8 Rd232 2011-05-08 21:07:55 UTC
@Alexandre Emsenhuber:

---
Also a problem wouldbe parameter substitution: {{Some template|link=[[Some page]]}} or {{Link|page=Some page}} where Template:Link contains something like
"[[{{{page}}}]]", for those two cases, should the link be considered as comming
from the page, or the template? (first example might be easier than the second
one)
--

Those cases should clearly be considered as coming from the page calling Template:Link, since "some page" is linking data stored in the calling page, not the template.
Comment 9 Krinkle 2011-05-08 21:28:30 UTC
(In reply to comment #8)
> @Alexandre Emsenhuber:
> 
> ---
> Also a problem wouldbe parameter substitution: {{Some template|link=[[Some
> page]]}} or {{Link|page=Some page}} where Template:Link contains something like
> "[[{{{page}}}]]", for those two cases, should the link be considered as comming
> from the page, or the template? (first example might be easier than the second
> one)
> --
> 
> Those cases should clearly be considered as coming from the page calling
> Template:Link, since "some page" is linking data stored in the calling page,
> not the template.

Yeah, that's easy to say for a human. But a piece of software is likely not going to able to distiguish that.

for example:

Template:Foo contains:
> This is a [[department]] [[portal]].
> ----
> {{#ifeq: {{{type|normal}}} | special | Welcome to the [[special]]
> department. | Welcome to the department page of the [[normal people]].}}

Department:Special contains:
> {{Foo|type=special}}
> Blablablabla.
> [[Category:Departments|Special]]

Does the link to [[special]] come from the template or from the article ?
The answer to this doesn't matter and likely not obvious, but untill the parser has been rewritten and world piece has been made I dont think such advanced extractions can be made from a simple page with templates.

That doesn't mean we can't do any extractions at all. A simple way to approach this bug's goal would be to compare links generated from {{Foo}} to whatever the template call was (eg. {{Foo}}), and whatever was added consider that caused by the article, and the rest to be coming from the template and thus further down the tree on WhatLinksHere.

(things to keep in mind though are constructions with <includeonly> and the like, and comparisons to {{PAGENAME}} etc.)
Comment 10 Rd232 2011-05-08 22:33:46 UTC
@krinkle

I'm not sure it has to be that complicated. Any time a template wraps a parameter in [[ ]], it's link data the calling page is responsible for. Otherwise, it's link data stored in the template. Though comparing links from the template and the template call, as you suggest, may be helpful.

I'm sure there are hard cases which may be generated what might be considered categorisation errors, but this system doesn't have to be perfect in correctly including/excluding templates, as long it categorises links one way or the other. (I'm imagining there would be a switch so you could choose to look at page links, templates links, or both together.)
Comment 11 Helder 2011-09-30 16:48:31 UTC
*** Bug 17728 has been marked as a duplicate of this bug. ***
Comment 12 Helder 2011-09-30 16:50:00 UTC
*** Bug 21266 has been marked as a duplicate of this bug. ***
Comment 13 Umherirrender 2012-08-04 22:30:12 UTC
Sounds like bug 1392
Comment 14 Quim Gil 2013-07-12 13:23:15 UTC
Or like Bug 3241 - Transclusion should produce tree-like results in "What links here"

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links