Last modified: 2014-02-25 14:45:12 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 T59057, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 57057 - API lacks a method to query redirects to a title
API lacks a method to query redirects to a title
Status: RESOLVED FIXED
Product: MediaWiki
Classification: Unclassified
API (Other open bugs)
1.23.0
All All
: Normal enhancement (vote)
: ---
Assigned To: Brad Jorsch
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2013-11-14 16:27 UTC by Fomafix
Modified: 2014-02-25 14:45 UTC (History)
5 users (show)

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


Attachments

Description Fomafix 2013-11-14 16:27:37 UTC
To show the redirects to a title you can use the link:

https://de.wikipedia.org/w/index.php?title=Special:WhatLinksHere/Berlin&hidelinks=1

For the article [[de:Berlin]] the following 4 redirects exist:
* [[de:Land Berlin]]
* [[de:DE-BE]]
* [[de:Freie Hansestadt Berlin]]
* [[de:Stadt Berlin]]

The API has the following query:

https://de.wikipedia.org/w/api.php?action=query&list=backlinks&bltitle=Berlin&blfilterredir=redirects&bllimit=50

The response contains 31 items:
<?xml version="1.0"?>
<api>
  <query>
    <backlinks>
      <bl pageid="598689" ns="0" title="Land Berlin" redirect="" />
      <bl pageid="830872" ns="0" title="DE-BE" redirect="" />
      <bl pageid="1131942" ns="0" title="Max Contag" redirect="" />
      <bl pageid="1131945" ns="0" title="Christian Havestadt" redirect="" />
      <bl pageid="1192706" ns="0" title="Willi Freitag" redirect="" />
      <bl pageid="1361427" ns="0" title="Roger Rossmeisl" redirect="" />
      <bl pageid="2369732" ns="0" title="Elisabeth Concordia Crola" redirect="" />
      <bl pageid="2440334" ns="0" title="Felicie Bernstein" redirect="" />
      <bl pageid="2536783" ns="0" title="Carl Bernstein (Kunstsammler)" redirect="" />
      <bl pageid="2782294" ns="0" title="Jörg Hartmann (Maueropfer)" redirect="" />
      <bl pageid="2782381" ns="0" title="Lothar Schleusener" redirect="" />
      <bl pageid="4282137" ns="0" title="Mieze Katz" redirect="" />
      <bl pageid="4506411" ns="0" title="Mark Lehmstedt" redirect="" />
      <bl pageid="4530698" ns="0" title="Eckhard Wehage" redirect="" />
      <bl pageid="4530700" ns="0" title="Christel Wehage" redirect="" />
      <bl pageid="4778961" ns="0" title="Brigitte Matschinsky-Denninghoff" redirect="" />
      <bl pageid="5035043" ns="0" title="Lucie Berlin" redirect="" />
      <bl pageid="5240111" ns="0" title="Matthias Nowak" redirect="" />
      <bl pageid="5288707" ns="0" title="Otto Freitag (Fußballspieler)" redirect="" />
      <bl pageid="5629793" ns="0" title="Jean-Rodrique Funke" redirect="" />
      <bl pageid="5684248" ns="0" title="Wolfgang Preuß" redirect="" />
      <bl pageid="6239882" ns="0" title="Sven Gillert" redirect="" />
      <bl pageid="6469922" ns="0" title="Freie Hansestadt Berlin" redirect="" />
      <bl pageid="7110028" ns="0" title="Augustin Terwesten" redirect="" />
      <bl pageid="7117879" ns="0" title="Lucius Reichling" redirect="" />
      <bl pageid="7441473" ns="0" title="BND-Zentrale" redirect="" />
      <bl pageid="7545608" ns="0" title="Sayed Kamal" redirect="" />
      <bl pageid="7610976" ns="0" title="Minnie Maria Kronfeld" redirect="" />
      <bl pageid="7664773" ns="0" title="Iwan Kutisker" redirect="" />
      <bl pageid="7752064" ns="0" title="Stadt Berlin" redirect="" />
      <bl pageid="7766833" ns="0" title="Wilhelm Olschewski junior" redirect="" />
    </backlinks>
  </query>
</api>

All items are redirects. But only 4 redirect to the article [[de:Berlin]]. The other redirects redirect to other articles. But they contain an invisible link to [[de:Berlin]].

Is this a bug or is there an other API query to get only the redirects to the title?
Comment 1 Umherirrender 2013-11-14 16:37:16 UTC
This is a bug, because only the page_is_redirect field is checked on api, not, if the redirect page has the correct target.

Special:Whatlinkshere is checking the redirect table with a LEFT JOIN.
Comment 2 Brad Jorsch 2014-01-14 20:53:20 UTC
(In reply to comment #1)
> This is a bug, because only the page_is_redirect field is checked on api,

No it's not. list=backlinks is doing exactly what it's supposed to do here.

(In reply to comment #0)
> or is there an other API query to get only the redirects to the title?

No, there isn't. And that *is* a bug. Retitling and adjusting accordingly.
Comment 3 Gerrit Notification Bot 2014-01-14 20:53:43 UTC
Change 104764 had a related patch set uploaded by Anomie:
API: Add prop=redirects and list=allredirects

https://gerrit.wikimedia.org/r/104764
Comment 4 Gerrit Notification Bot 2014-02-24 21:52:05 UTC
Change 104764 merged by jenkins-bot:
API: Add prop=redirects and list=allredirects

https://gerrit.wikimedia.org/r/104764
Comment 5 Brad Jorsch 2014-02-25 14:45:12 UTC
This should be deployed to WMF sites with 1.23wmf16, see https://www.mediawiki.org/wiki/MediaWiki_1.23/Roadmap for the schedule.

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


Navigation
Links