Last modified: 2013-06-18 15:40:57 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 T9304, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 7304 - Redirect pages should not create multiple rows in pagelinks table. Causes invalid entries on WhatLinksHere.
Redirect pages should not create multiple rows in pagelinks table. Causes inv...
Status: RESOLVED FIXED
Product: MediaWiki
Classification: Unclassified
Redirects (Other open bugs)
unspecified
All All
: Normal normal with 15 votes (vote)
: 1.20.0 release
Assigned To: Nobody - You can work on this!
http://en.wikipedia.org/w/index.php?t...
: patch, patch-need-review
: 12971 16218 (view as bug list)
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2006-09-13 04:52 UTC by Yuri Astrakhan
Modified: 2013-06-18 15:40 UTC (History)
14 users (show)

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


Attachments
special:whatlinkshere using redirect table instead of page_is_redirect (2.83 KB, patch)
2011-09-30 18:33 UTC, Bawolff (Brian Wolff)
Details

Description Yuri Astrakhan 2006-09-13 04:52:33 UTC
When template is transcluded into a redirect page, and the template contains one
or more links, multiple rows are created in the pagelinks table. For the page
"Price, UT" in enwiki (ID=829925), 3 rows are created (can be checked in db),
but the page only renders the category link at the bottom.
Comment 1 Yuri Astrakhan 2006-09-13 05:05:16 UTC
Example:
http://en.wikipedia.org/w/index.php?title=Special:Whatlinkshere&target=United_States_postal_abbreviations
shows that there are lots of redirects pointing to
[[United_States_postal_abbreviations]], whereas in reality they are not
redirecting to it.
Comment 2 Tim Starling 2006-09-24 06:27:59 UTC
Needs separate parser entry point which registers only the redirect link plus
any categories. We could probably include language links as well.
Comment 3 Brion Vibber 2006-09-25 22:19:10 UTC
My recommendation is a redirectlinks table; then the other links tables could do 
whatever they liked. (A redirect target field on the page table has also been 
suggested, but would be a more painful upgrade and may waste table space.)
Comment 4 Yuri Astrakhan 2006-09-25 23:31:33 UTC
Agree with Brion - let redirect pages have any links ppl want, yet putting a
redirect link into the page table will waste tons of space. Hence - I'm all for
the new table.  Also, the actual process of redirecting might be efficient with
a single value lookup. 

Added the proposed table structure at
http://meta.wikimedia.org/wiki/Proposed_Database_Schema_Changes :
CREATE TABLE  `wikidb`.`redirectlinks` (
  `rl_from` int(8) unsigned NOT NULL default '0',
  `rl_namespace` int(11) NOT NULL default '0',
  `rl_title` varchar(255) character set latin1 collate latin1_bin NOT NULL default ,
  PRIMARY KEY  (`rl_from`),
  KEY `rl_namespace` (`rl_namespace`,`rl_title`,`rl_from`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
Comment 5 Yuri Astrakhan 2006-10-27 04:19:50 UTC
Added patch-redirect.sql to the archive dir:

CREATE TABLE /*$wgDBprefix*/redirect (
  rd_from int(8) unsigned NOT NULL default '0',
  rd_namespace int NOT NULL default '0',
  rd_title varchar(255) binary NOT NULL default '',
  PRIMARY KEY rd_from (rd_from),
  KEY rd_ns_title (rd_namespace,rd_title,rd_from)
) TYPE=InnoDB;

The table will be pre-populated from pagelinks table using:

INSERT IGNORE
  INTO /*$wgDBprefix*/redirect (rd_from,rd_namespace,rd_title)
  SELECT pl_from,pl_namespace,pl_title
    FROM /*$wgDBprefix*/pagelinks, /*$wgDBprefix*/page
    WHERE pl_from=page_id AND page_is_redirect=1;

The code to begin using redirect table will be posted after wiki tables get
modified to avoid scap problems.
Comment 6 Yuri Astrakhan 2006-10-29 21:37:03 UTC
The table has been created in the DB, and a patch (yurik r17291
/trunk/phase3/includes/Article.php) has been checked in. The patch will update
the redirect table on each save. Eventually the table should be used to find the
target of every redirect, both for API and regular web navigation.
Comment 7 Graham87 2008-09-10 08:07:27 UTC
This bug caused the accidental deletion of a user talk page on the English Wikipedia. See http://en.wikipedia.org/wiki/Wikipedia:Bot_owners%27_noticeboard#Automated_tools_leaving_messages_on_redirected_user_talk_pages
Comment 8 CBM 2008-09-10 14:21:08 UTC
*** Bug 12971 has been marked as a duplicate of this bug. ***
Comment 9 Mike.lifeguard 2008-10-30 05:15:40 UTC
tbl == TitleBlackList; let's use the whole word
Comment 10 Mike.lifeguard 2008-10-30 05:22:42 UTC
(In reply to comment #9)
> tbl == TitleBlackList; let's use the whole word
> 

Sorry, that was unclear. The summary previously used 'tbl' for 'title' which is misleading since TBL normally means TitleBlackList. I've changed the summary to use the full word for clarity.
Comment 11 CBM 2008-12-18 14:00:24 UTC
*** Bug 16218 has been marked as a duplicate of this bug. ***
Comment 12 Avi Rosenschein 2008-12-28 08:56:47 UTC
This also causes the output of the backlinks list in the API to include incorrect links.

For example: http://en.wikipedia.org/w/api.php?action=query&list=backlinks&blredirect&bllimit=100&blnamespace=0&blfilterredir=redirects&bltitle=Plural shows that there are many articles that redirect to "Plural" when in fact they redirect to other articles.
For example 'Companies' is the plural of 'Company' so the article 'Companies' naturally redirects to 'Company', but is also listed as a redirect to 'Plural'.
Comment 14 Yishai 2009-02-18 16:41:34 UTC
Another example similar to that in Comment #12:

http://en.wikipedia.org/w/api.php?action=query&list=backlinks&blredirect&bllimit=100&blnamespace=0&blfilterredir=redirects&bltitle=Common%20name
shows that there are thousands of redirects to the article 'Common name'
Comment 15 Yishai 2009-07-13 14:13:14 UTC
Some of the most problematic articles (the ones with many redirects) are:
Trade name
New Jersey
New York City
Television
Common Name
Abbreviation
Geocode
Comment 16 Ari Brodsky 2011-06-07 08:45:26 UTC
Here's a very problematic one:
http://en.wikipedia.org/wiki/Special:WhatLinksHere/wp:redirect
Lots of redirect templates contain a link to [[wp:redirect]], and each of those templates is added to many redirect pages.  So the WhatLinksHere shows all of those pages as redirects to [[wp:redirect]], and shows second-level backlinks for all of them as well.  This makes is impossible to find a list of pages that actually redirect to [[wp:reidrect]].
Comment 18 Ari Brodsky 2011-06-30 22:20:03 UTC
It is not necessarily bad (and may even be desirable) for the pagelinks table to include additional links from redirect pages after the redirect.  The problem is that the table must distinguish the link that is actually the redirect target from other links after the redirect.  Only the former should be marked as "redirect" in the table.

From the comments above, there was discussion of a patch way back in 2006.  What happened?
Comment 19 Bawolff (Brian Wolff) 2011-09-30 18:33:00 UTC
Created attachment 9133 [details]
special:whatlinkshere using redirect table instead of page_is_redirect

(In reply to comment #18)
> It is not necessarily bad (and may even be desirable) for the pagelinks table
> to include additional links from redirect pages after the redirect.  The
> problem is that the table must distinguish the link that is actually the
> redirect target from other links after the redirect.  Only the former should be
> marked as "redirect" in the table.
> 
> From the comments above, there was discussion of a patch way back in 2006. 
> What happened?

We have a redirect table. Its not used currently with special:whatlinkshere, but it probably could be.

Attached is a quick patch doing that. Havn't really tested it. ( its just rought, might not use the proper db funcs in all places)


(also changing status back to new(?) since its only assigned to wikibugs)
Comment 20 Sumana Harihareswara 2011-11-10 02:54:00 UTC
Adding "need-review" keyword to signal to other developers to give Bawolff feedback on his approach.  Thanks for the patch, Bawolff.
Comment 21 Roan Kattouw 2011-11-20 14:34:01 UTC
(In reply to comment #19)
> We have a redirect table. Its not used currently with special:whatlinkshere,
> but it probably could be.
> 
> Attached is a quick patch doing that. Havn't really tested it. ( its just
> rought, might not use the proper db funcs in all places)
Patch worked just fine as it was. Applied verbatim in r103758.

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


Navigation
Links