Page MenuHomePhabricator

Wikicode in map data in all projects is parsed against en.wikipedia.org if data is from SPARQL
Open, MediumPublic

Description

If mapframe shape/point comes from SPARQL query then the wikicode which comes from the query is parsed against en.wikipedia.org and not against the domain where the actual map is.

This means that internal links on projects other than enwiki appear blue or red depending on if pages titled the same exist or doesn't exist on enwiki, and w:, en: interwiki prefixes are resolved to no prefix the way they are treated in enwiki. See frwiki examples here: https://fr.wikipedia.org/w/index.php?title=Utilisateur:Golmote/Brouillon&oldid=198634430

Also if map data includes a template call then enwiki template is used: mediawiki.org example map, template used [template deleted on 7 March 2019]

Event Timeline

MSantos claimed this task.
MSantos subscribed.

Comparing the following links, it seems to be resolved. Please reopen in case I am missing something.

Still broken.

Maybe it is easier to explain with mediawiki.org

If you do next:

  1. Open map in mediawiki.org
  2. If you look the wikicode in maptest page you see that the content of the popup comes from Template:Kartographer_WLM_pin
  3. There is no Template:Kartographer_WLM_pin in mediawiki.org
  4. However when you open the map and click buildings popup will magically work
  5. It is because template is rendered using enwiki and template used is https://en.wikipedia.org/wiki/Template:Kartographer_WLM_pin
MSantos triaged this task as Medium priority.Mar 6 2019, 6:05 PM

@Zache, thanks I understand the issue now. I will triage it now considering your comment. If you have more info that you think is useful, please let me know.

Also, the example doesn't work currently because template was deleted in enwiki.

TheDJ subscribed.

Confirm that this is still a problem. Kartotherian seems to do all its parsing against en.wikipedia.org, instead of the domain it should be using...

    // TODO: we shouldn't use it directly,
    // but instead refactor out mwapi lib from node_service_template
    // and use the proper host
const mwapi = core.getConfiguration().mwapi_req;
config.mwapi = (mwapi && mwapi.uri) || 'https://en.wikipedia.org/w/api.php';

https://github.com/wikimedia/mediawiki-services-kartotherian/blob/4592692ddc14dc2fb3f20f5756fa2cf92dc6023a/packages/geoshapes/index.js#L43

Pikne renamed this task from Wikicode in map data is always rendered in enwiki if data is from Sparql to Wikicode in map data in all projects is parsed against en.wikipedia.org if data is from SPARQL.Mar 7 2024, 1:29 PM
Pikne updated the task description. (Show Details)