Page MenuHomePhabricator

Special:Whatlinkshere shows no more than 500 links through each redirect
Closed, ResolvedPublic

Description

Author: sjorford

Description:
Special:Whatlinkshere shows up to 500 direct links per page, with options for
"previous/next 500". For each incoming redirect, it additionally shows up to 500
links through that redirect. However, this second limit of 500 seems to be
unrelated to the first limit, and no "next 500" option is available. See
[[w:en:Liberal Democrats]], where there are under 500 direct links, but over
2000 through [[Liberal Democrats (UK)]], and there is no way of viewing all the
redirected links on [[Special:Whatlinkshere/Liberal Democrats]].
[[Special:Whatlinkshere/Liberal Democrats (UK)]] shows all the redirected links
fine.


Version: 1.7.x
Severity: normal
URL: http://en.wikipedia.org/w/index.php?title=Special:Whatlinkshere/Liberal_Democrats&limit=500&from=0

Details

Reference
bz5745

Event Timeline

bzimport raised the priority of this task from to Medium.Nov 21 2014, 9:12 PM
bzimport set Reference to bz5745.
bzimport added a subscriber: Unknown Object (MLST).

robchur wrote:

Probably a hard limit due to performance concerns.

It is currently set to a hard limit. The following patch would allow a global variable to set that number.

Index: SpecialWhatlinkshere.php

  • SpecialWhatlinkshere.php (revision 24102)

+++ SpecialWhatlinkshere.php (working copy)
@@ -73,7 +73,7 @@

    • @private */ function showIndirectLinks( $level, $target, $limit, $from = 0, $back = 0 ) {
  • global $wgOut;

+ global $wgOut, $wgShowMaxRedirectLinks;

		$fname = 'WhatLinksHerePage::showIndirectLinks';
		$dbr = wfGetDB( DB_READ );
		$options = array();

@@ -240,7 +240,7 @@

			
			if ( $row->page_is_redirect ) {
				if ( $level < 2 ) {
  • $this->showIndirectLinks( $level + 1, $nt, 500 );

+ $this->showIndirectLinks( $level + 1, $nt, $wgShowMaxRedirectLinks );

				}
			}
			$wgOut->addHTML( "</li>\n" );

I applied this with a few changes in r32303. If more than 500 such links are wanted on a wiki, $wgMaxRedirectLinksRetrieved can be set to the desired value on LocalSetting.php