Last modified: 2014-10-29 07:31:12 UTC

Wikimedia Bugzilla is closed!

Wikimedia has migrated from Bugzilla to Phabricator. Bug reports should be created and updated in Wikimedia Phabricator instead. Please create an account in Phabricator and add your Bugzilla email address to it.
Wikimedia Bugzilla is read-only. If you try to edit or create any bug report in Bugzilla you will be shown an intentional error message.
In order to access the Phabricator task corresponding to a Bugzilla report, just remove "static-" from its URL.
You could still run searches in Bugzilla or access your list of votes but bug reports will obviously not be up-to-date in Bugzilla.
Bug 50414 - API module for RelatedSites extension
API module for RelatedSites extension
Status: NEW
Product: MediaWiki extensions
Classification: Unclassified
RelatedSites (Other open bugs)
All All
: Normal enhancement (vote)
: ---
Assigned To: Nobody - You can work on this!
Depends on:
Blocks: noncoreapi
  Show dependency treegraph
Reported: 2013-06-29 05:08 UTC by Kunal Mehta (Legoktm)
Modified: 2014-10-29 07:31 UTC (History)
4 users (show)

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


Description Kunal Mehta (Legoktm) 2013-06-29 05:08:52 UTC
There should be a prop=relatedsites module which provides a list of all the related sites.

This will be extremely useful during the Wikidata migration when trying to connect a Wikivoyage page with the Wikidata one.

For some reason the original version of the mw documentation page claims it uses the API, but I can't find anything in the code to indicate that. (
Comment 1 RolandUnger 2013-07-23 06:24:46 UTC
Unfortunately I have no experience with the API and how to work with the Git repository so I will give at least two ideas:

(1) The API function should be similar to prop=langlinks (ll)

(2) From the public function onSkinTemplateToolboxEnd( &$skinTpl ) (at the end of RelatedSites.class.php) you can learn how to access to the stored values:

$relatedSites = $this->getCustomData()->getSkinData( $skinTpl, 'RelatedSites' );

if ( count( $relatedSites ) == 0 ) {
	return true;

$relatedSitesUrls = $this->getRelatedSitesUrls( $relatedSites );

foreach ( (array) $relatedSitesUrls as $url ) {
	$href = htmlspecialchars( $url['href'] );
	$text = $url['text'];

Now you can check for Wikipedia and Commons. $url['text'] should contain "Wikipedia", "Wikimedia Commons" and others.

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