Semanticmediawiki: Map output format not working (infinitely loading, no JavaScript errors)

Created on 11 Nov 2020  路  3Comments  路  Source: SemanticMediaWiki/SemanticMediaWiki

Setup

  • SMW version: 3.1.6 / 3.2.0
  • MW version: 1.34.4
  • PHP version: 7.3.24
  • DB system (MySQL, Blazegraph, etc.) and version: 5.5.56-MariaDB
  • Maps: 7.20.1

Issue

On non-article pages, such as Special:ExpandTemplates or Special:RunQuery, the map does not load.

Running mw.loader.load( 'ext.maps.leaflet.loader' ) on the Console makes the map appear.

Steps to reproduce the observation (recommendation is to use the sandbox):

At the time of writing:

  1. Go to https://nimiarkisto.nikerabb.it/wiki/Toiminnot:Mallineiden_laajennus
  2. Paste the query below and preview
{{#ask:[[Pistekoordinaatti::+]]
 |?Pistekoordinaatti
 |format=map
 |limit=10
}}

Rant

Please set the language to English if you want people to reproduce on the sandbox.

I tried to reproduce by pasting the following query on Special:ExpandTemplates:

{{#ask:[[Has coordinates::*]]
 |?Has coordinates
 |format=map
}}

Instead I got this error:

[eef663560f86839b2100217c] /wiki/Sp%C3%A9cial:ExpansionDesMod%C3%A8les TypeError from line 46 of /var/www/html/sbxsmw/w/extensions/SemanticMediaWiki/includes/formatters/MessageFormatter.php: Argument 1 passed to SMW\MessageFormatter::__construct() must be an instance of Language, instance of StubUserLang given, called in /var/www/html/sbxsmw/w/extensions/SemanticMediaWiki/src/ParserFunctionFactory.php on line 133

Backtrace:

#0 /var/www/html/sbxsmw/w/extensions/SemanticMediaWiki/src/ParserFunctionFactory.php(133): SMW\MessageFormatter->__construct(StubUserLang)
#1 /var/www/html/sbxsmw/w/extensions/SemanticMediaWiki/src/ParserFunctionFactory.php(395): SMW\ParserFunctionFactory->newAskParserFunction(Parser)
#2 /var/www/html/sbxsmw/w/includes/parser/Parser.php(3340): SMW\ParserFunctionFactory->SMW\{closure}(Parser, string, string, string, string, string, string, string, string, string, string, string, string, string, string, string, string, string, string, string, string, string)
#3 /var/www/html/sbxsmw/w/includes/parser/Parser.php(3047): Parser->callParserFunction(PPFrame_Hash, string, array)
#4 /var/www/html/sbxsmw/w/includes/parser/PPFrame_Hash.php(253): Parser->braceSubstitution(array, PPFrame_Hash)
#5 /var/www/html/sbxsmw/w/includes/parser/Parser.php(2887): PPFrame_Hash->expand(PPNode_Hash_Tree, integer)
#6 /var/www/html/sbxsmw/w/includes/parser/Parser.php(927): Parser->replaceVariables(string, PPFrame_Hash)
#7 /var/www/html/sbxsmw/w/includes/specials/SpecialExpandTemplates.php(93): Parser->preprocess(string, Title, ParserOptions)
#8 /var/www/html/sbxsmw/w/includes/specialpage/SpecialPage.php(600): SpecialExpandTemplates->execute(NULL)
#9 /var/www/html/sbxsmw/w/includes/specialpage/SpecialPageFactory.php(635): SpecialPage->run(NULL)
#10 /var/www/html/sbxsmw/w/includes/MediaWiki.php(307): MediaWiki\SpecialPage\SpecialPageFactory->executePath(Title, RequestContext)
#11 /var/www/html/sbxsmw/w/includes/MediaWiki.php(940): MediaWiki->performRequest()
#12 /var/www/html/sbxsmw/w/includes/MediaWiki.php(543): MediaWiki->main()
#13 /var/www/html/sbxsmw/w/index.php(53): MediaWiki->run()
#14 /var/www/html/sbxsmw/w/index.php(46): wfIndexMain()
#15 {main}
bug

All 3 comments

The pasted link gives me 404

This is likely a Maps issue and better posted at https://github.com/JeroenDeDauw/Maps/issues

For future issues you could try using https://maps.extension.wiki/wiki/Maps_for_MediaWiki. Not 100% sure if user registration is working though :)

Actually not sure it is a Maps issue. Either maps is not extending SMW correctly or there is some more general SMW bug that causes registered resources to not be loaded in certain contexts.

I checked the Maps code and am not seeing anything obviously wrong. https://github.com/JeroenDeDauw/Maps/blob/master/src/Map/SemanticFormat/MapPrinter.php#L150-L167

The pasted link gives me 404

Yeah sorry, I did not remember the DNS is wrong and even then the SSL certificate has expired.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

osnard picture osnard  路  3Comments

SteveRMann picture SteveRMann  路  4Comments

alex-mashin picture alex-mashin  路  4Comments

jaideraf picture jaideraf  路  3Comments

plegault3397 picture plegault3397  路  3Comments