Page MenuHomePhabricator

Geodata shouldn't fail if I request codistancefrompage
Closed, ResolvedPublic

Description

The following query asks for distance from the page Huay Xai
https://en.wikivoyage.org/w/api.php?action=query&format=json&formatversion=2&codistancefrompage=Huay%20Xai&redirects=&prop=coordinates%7Cpageimages%7Cpageterms&titles=Chiang%20Khong%7CLuang%20Prabang%7CLuang%20Namtha%7CLuang%20Namtha%7CJinghong%7CMuang%20Xay%7CLuang%20Prabang%7CVientiane&pilimit=50&pithumbsize=120&colimit=max&wbptterms=description

... but since Huay Xai has no coordinates
I get the following response:

{"servedby":"mw1099","error":{"code":"co_no-coordinates","info":"Page ``Huay Xai'' has no primary coordinates","docref":"See https://en.wikivoyage.org/w/api.php for API usage"}}

(e.g. no page images and no coordinates... nothing)

Expected: This should throw a warning and simply omit the field coordinates.dist. Otherwise I have to query Huay Xai beforehand to see if it has coordinates.

Event Timeline

Change 743039 had a related patch set uploaded (by TheDJ; author: TheDJ):

[mediawiki/extensions/GeoData@master] Follow redirects for codistancefrompage

https://gerrit.wikimedia.org/r/743039

@ssastry, flagging you on this, as I remember your team owning geo now (instead of search)

Change 743039 merged by jenkins-bot:

[mediawiki/extensions/GeoData@master] Follow redirects for codistancefrompage

https://gerrit.wikimedia.org/r/743039