Page MenuHomePhabricator

API issues when fetching Wikidata information through infoboxes on enwp
Closed, ResolvedPublic

Description

User:Gapfall has reported a couple of problems when using the API to fetch information about English Wikipedia articles that have Wikidata-driven infoboxes, specifically:

Coordinates: "The coordinates show up at the top of the article, but this API query asking for coordinates doesn't get any back from Wikipedia.". Although this seems to be a wider issue.

Images: "the API serves up the map image instead of the infobox photo (eg. https://en.wikipedia.org/w/api.php?action=query&format=xml&prop=pageimages&titles=Sherwood%20Observatory), for articles that use this infobox"

I don't know how the API identifies coordinates/images, so I can't do much to fix this. I don't think that there is anything specific in the infobox coding that has changed except for fetching the info from Wikidata. It might be an issue with the Lua code that fetches the Wikidata info, but it's probably easier to debug on the API side to start with.

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald TranscriptJul 6 2017, 10:10 PM

Coordinates: I think the problem is in templates which don't use the API correctly (if at all).

Images: https://www.mediawiki.org/wiki/Extension:PageImages#Image_choice may answer your questions.

It ultimately turned out that "nosave=1" when passed to the coord template disabled the coordinates in the API. Removing that parameter should now have resolved this.

Mike_Peel closed this task as Resolved.Aug 17 2018, 9:45 PM
Gapfall added a subscriber: Gapfall.Mar 6 2020, 4:13 PM

@Mike_Peel I hadn't looked at this for a while, but the coord issue looks to be broken again. Someone put "nosave=1" back?