Page MenuHomePhabricator

Update the code behind the Wikimedia Commons link in the sidebar to use P910 and P1754 instead of P373
Open, HighPublic


The sidebar link to Wikimedia Commons on various Wikipedias currently uses P373. It would be better to use the interwiki sitelinks to Commons instead. The logic in this case would be:

  1. If there is a sitelink to Commons in the attached Wikidata item, use that (optional: unless it is to a gallery page)
  2. If there is a P910 value, follow that to the category item and use the sitelink to Commons from there
  3. If there is a P1754 value, follow that to the category item and use the sitelink to Commons from there
  4. Otherwise, display nothing.

This follows the logic of the "_getCommonslink" function of - which is used to display the links in .

This is one of the blockers for the eventual deletion of P373 from Wikidata - see the ongoing discussion at

Event Timeline

Restricted Application added subscribers: Liuxinyu970226, Aklapper. · View Herald TranscriptSep 14 2019, 6:14 PM
Reedy updated the task description. (Show Details)Sep 14 2019, 7:36 PM
Reedy edited projects, added Wikimedia-Interwiki-links; removed MediaWiki-Interwiki.

@Lydia_Pintscher Is this within WMDE's scope, or WMF? It would be nice to have this actioned at some point.

Mike_Peel triaged this task as High priority.Apr 4 2020, 7:22 PM

Anyone? There are quite a few commons links that aren't being displayed because the logic here hasn't been updated.

@Jdlrobson I saw you were working on the sidebar recently (for the language vs. other sites order), is this something you/your team would be interested in?

@Mike_Peel we've been working on the architecture of the sidebar not consumers like this. My team doesn't have much knowledge of the Wikidata extension or have it setup.

Without understanding this code is this not simply a config change here ?:

Mike_Peel added a subscriber: Jdlrobson.EditedJun 26 2020, 6:42 PM

@Jdlrobson I think part of it is removing P 373 from that config, and that alone would be a good step forward. However, the other part is to follow P 910/P 1754 items through to a different Wikidata item, and to fetch the Commons sitelink from that - and that's probably more complicated/requires code change rather than just a config change.

If it's not in your team's scope, can you suggest anyone who might be able to look into it? It's been stuck here for a while now, and it's fairly high priority if we want to get rid of P 373 on Wikidata at some point soon.

(Sorry, I don't know how to ping you in reply without re-adding you as a subscriber!)

Because this is Wikibase it suggests WMDE Engineering is the team to look at this.

OK, back to pinging @Lydia_Pintscher and @Lea_Lacroix_WMDE then (please?). ;-)

Thanks for the ping, we will have a look more in details and come back to you.

Robby added a subscriber: Robby.Aug 1 2020, 11:23 AM