Page MenuHomePhabricator

Maps from Commons not displayed in mobile-full-screen mode due to CORS
Closed, ResolvedPublicBUG REPORT

Description

Steps to replicate the issue (include links if applicable):

  • Switch the map to full-screen mode.

What happens?:

The routes and points on the map are no longer displayed.

What should have happened instead?:

The routes and points on the map should be displayed

Software version (skip for WMF-hosted wikis like Wikipedia):

Other information (browser name/version, screenshots, etc.):

Root Cause Analysis:
The problem occurs only when the map is included in Wikimedia Commons. If the GeoJSON embeds directly between the mapframe tags it works.

Event Timeline

I could reproduce this with mobile view on Chrome desktop. I think the problem is that a request for jsondata is blocked because of CORS on de.m.wikipedia.org:

Access to XMLHttpRequest at 'https://de.wikipedia.org/w/api.php?format=json&formatversion=2&action=jsondata&title=Strecke+Paderborner+Osterlauf+2023.map' from origin 'https://de.m.wikipedia.org' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource.

The same request doesn't fail on de.wikipedia.org and full screen map is rendered properly.
The mobile version should have requested the same API query from the mobile endpoint de.m.wikipedia.org/w/api.php

Jgiannelos triaged this task as Medium priority.Feb 2 2023, 10:16 AM
Aklapper renamed this task from Maps from Commons are not displayed in mobile-full-screen mode to Maps from Commons not displayed in mobile-full-screen mode due to CORS.Feb 2 2023, 11:05 AM

Change 885940 had a related patch set uploaded (by Awight; author: Awight):

[mediawiki/extensions/Kartographer@master] Revert "Provide Commons data via full URL"

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

Change 885940 merged by jenkins-bot:

[mediawiki/extensions/Kartographer@master] Revert "Provide Commons data via full URL"

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

thiemowmde claimed this task.