Page MenuHomePhabricator

Wikicode in map data is always rendered in enwiki if data is from Sparql
Open, MediumPublic

Description

If mapframe shape comes from Sparql query then the wikicode which comes from the query is rendered in enwiki and not in the wiki where the actual map is.

<mapframe text="text" align="right" width="265" height="250" zoom="14" longitude="25.7342" latitude="62.23766">[
{
  "type": "ExternalData",
  "service": "geoshape",
  "query": '
   SELECT DISTINCT 
      (?item as ?id) 
      ?itemLabel 
      (?itemLabel as ?title) 
      (concat("{{SERVERNAME}}<hr>{{CURRENTTIMESTAMP}}<hr>{{Kartographer WLM pin|wikidata=", substr(str(?item),32,250),  "}}") as ?description)  
  WHERE {
     ?item wdt:P31/wdt:P279* wd:Q41176 .
     ?item wdt:P276 wd:Q11892928.
     OPTIONAL { ?item wdt:P625 ?coor. }
     SERVICE wikibase:label { bd:serviceParam wikibase:language "fi,sv,en". 
  }
}
ORDER BY ?itemLabel'
}

]</mapframe>

Event Timeline

MSantos claimed this task.
MSantos added a subscriber: MSantos.

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
MSantos moved this task from Needs triage to Backlog on the Product-Infrastructure-Team-Backlog board.

@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 added a subscriber: TheDJ.

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