Page MenuHomePhabricator

Maps GeoJSON errors are reported as missing "query" when this is not the problem
Closed, ResolvedPublicBUG REPORT

Description

List of steps to reproduce

  • Create a .map in the Wikimedia Commons "Data" namespace.
  • Paste this minimal example:
{
    "license": "CC0-1.0",
    "zoom": 11,
    "latitude": 40.782222,
    "longitude": -73.965278,
    "data": {
        "type": "Feature",
        "feature": {
			"type": "ExternalData",
			"service": "geoshape",
			"query": "select ?id from foobar"
		}
    }
}
  • Preview the map.

What happens?:
An error appears:

<mapframe>: The JSON content is not valid GeoJSON+simplestyle. The first validation error is on the element "/0/query": "The property query is required".

What should have happened instead?:
The error should be something like "ExternalData not supported here"—or the query should execute (currently not supported, see T155927). There is no missing "query" property, I believe this is reported by the schema rule here, but "/0" is confusing.

No error is reported if the externalData is replaced by a geometry feature.

Software version (if not a Wikimedia wiki), browser information, screenshots, other information, etc.:

Event Timeline

Change 826520 had a related patch set uploaded (by Thiemo Kreuz (WMDE); author: Thiemo Kreuz (WMDE)):

[mediawiki/extensions/Kartographer@master] Show all GeoJSON validation errors

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

Change 826520 had a related patch set uploaded (by Thiemo Kreuz (WMDE); author: Thiemo Kreuz (WMDE)):

[mediawiki/extensions/Kartographer@master] Show all GeoJSON validation errors

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

I'm not sure if the patch alone improves the situation. I tested it with "just" a mistake in the marker-color and it forwards a lot of irrelevant stuff.

ErrorMessageSavedExpanded.png (633×999 px, 161 KB)

IMO we should de-verbose these error messages before putting this in front of the user.

awight claimed this task.

+1 that we should try to show human-readable errors instead. But the patch being merged here will at least solve the main problem reported, that the "query" field is not relevant to fixing the GeoJSON.

Change 826520 merged by jenkins-bot:

[mediawiki/extensions/Kartographer@master] Show all GeoJSON validation errors

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