Page MenuHomePhabricator

API module `query.backlinks` returns different result compares to [[Special:WhatLinksHere]]
Closed, InvalidPublic


When I try to fetch the redirect pages of zh:User:Liangent I found a pretty weird behaviour: that the result from API gives a link to [[zh:User talk:Jimmy-bot]] which is a redirect page to zh:User talk:Jimmy-bot but contains link to [[zh:User:Liangent]].

The wikitext is like this:

#REDIRECT [[User talk:Jimmy Xu]]

Blah blah blah
-- [[User:Liangent|Liangent]] blah blah blah

This weird behaviour doesn't appear on Special:WhatLinksHere.

Event Timeline

PhiLiP raised the priority of this task from to Medium.
PhiLiP updated the task description. (Show Details)
PhiLiP added a project: MediaWiki-Action-API.
PhiLiP added subscribers: PhiLiP, liangent.
PhiLiP set Security to None.
Anomie claimed this task.
Anomie subscribed.

The list=backlinks module is correctly reporting the backlinks, filtered to only those backlinks that are also redirect pages. Your problem is that you're using list=backlinks with blfilterredir=redirects when you actually want to be using prop=redirects.

See also T59057: API lacks a method to query redirects to a title.

Restricted Application added a subscriber: Stang. · View Herald TranscriptOct 16 2020, 5:28 PM