Page MenuHomePhabricator

Special:WhatLinksHere only lists image link or transclusion, not both (when both do exist)
Open, MediumPublic

Description

The three foreach() loops here overwrite each other:

https://github.com/wikimedia/mediawiki/blob/d704f6d7f70338f95a7bf6db046612f0822f98e6/includes/specials/SpecialWhatlinkshere.php#L223-L243

That was done to avoid duplicates. However the props are also overwritten. Perhaps a check to see if it's been set already should be done and merge the is_template/is_image props.

Although we could choose to let one count stronger than the other (in this case imagelink, over templatelink, over pagelink) however the following code is clearly designed with the scenario in mind that multiple props could be set to 1:

https://github.com/wikimedia/mediawiki/blob/d704f6d7f70338f95a7bf6db046612f0822f98e6/includes/specials/SpecialWhatlinkshere.php#L339-L350

		$props = [];
		if ( $row->rd_from ) {
			$props[] = $msgcache['isredirect'];
		}
		if ( $row->is_template ) {
			$props[] = $msgcache['istemplate'];
		}
		if ( $row->is_image ) {
			$props[] = $msgcache['isimage'];
		}

URL: http://commons.wikimedia.org/w/index.php?title=Special%3AWhatLinksHere&target=File%3AExample.svg&namespace=2

Details

Reference
bz26904

Event Timeline

bzimport raised the priority of this task from to Medium.Nov 21 2014, 11:21 PM
bzimport set Reference to bz26904.
bzimport added a subscriber: Unknown Object (MLST).
  • Bug 26903 has been marked as a duplicate of this bug. ***
Krinkle renamed this task from WhatLinksHere only lists image link or transclusion, never both. to Special:WhatLinksHere only lists image link or transclusion, not both (when both do exist).Aug 17 2017, 1:54 AM