ProfessionalWiki / Maps

🗺 Maps is the MediaWiki extension that enables visualization of geographic data with dynamic embedded maps.
https://maps.extension.wiki
Other
73 stars 62 forks source link

Call to undefined method ParamProcessor\Processor::setParameterDefinitions() #750

Closed vgangt closed 1 year ago

vgangt commented 1 year ago

Hello, we have MW 1.39.4 LTS version in our RHEL 7 server. We have installed number of extensions and most of them are working properly. But Maps doesn't. Tried to add this one to show map, {{#display_map:center=Berlin|width=400|height=250}}

It throws below error: /wiki/index.php?title=Testmap&action=submit Error: Call to undefined method ParamProcessor\Processor::setParameterDefinitions()

Backtrace:

from /data/www/html/wiki/extensions/Maps/src/Map/DisplayMap/DisplayMapFunction.php(58)

0 /data/www/html/wiki/extensions/Maps/src/ParserHookSetup.php(80): Maps\Map\DisplayMap\DisplayMapFunction->getMapHtmlForKeyValueStrings()

1 /data/www/html/wiki/extensions/Maps/src/ParserHookSetup.php(58): Maps\ParserHookSetup->handleFunctionHook()

2 /data/www/html/wiki/includes/parser/Parser.php(3437): Maps\ParserHookSetup->Maps{closure}()

3 /data/www/html/wiki/includes/parser/Parser.php(3122): Parser->callParserFunction()

4 /data/www/html/wiki/includes/parser/PPFrame_Hash.php(275): Parser->braceSubstitution()

5 /data/www/html/wiki/includes/parser/Parser.php(2951): PPFrame_Hash->expand()

6 /data/www/html/wiki/includes/parser/Parser.php(1609): Parser->replaceVariables()

7 /data/www/html/wiki/includes/parser/Parser.php(723): Parser->internalParse()

8 /data/www/html/wiki/includes/content/WikitextContentHandler.php(301): Parser->parse()

9 /data/www/html/wiki/includes/content/ContentHandler.php(1721): WikitextContentHandler->fillParserOutput()

10 /data/www/html/wiki/includes/content/Renderer/ContentRenderer.php(47): ContentHandler->getParserOutput()

11 /data/www/html/wiki/includes/EditPage.php(4534): MediaWiki\Content\Renderer\ContentRenderer->getParserOutput()

12 /data/www/html/wiki/includes/EditPage.php(4437): EditPage->doPreviewParse()

13 /data/www/html/wiki/includes/EditPage.php(3143): EditPage->getPreviewText()

14 /data/www/html/wiki/includes/EditPage.php(778): EditPage->showEditForm()

15 /data/www/html/wiki/includes/actions/EditAction.php(73): EditPage->edit()

16 /data/www/html/wiki/includes/actions/SubmitAction.php(38): EditAction->show()

17 /data/www/html/wiki/includes/MediaWiki.php(542): SubmitAction->show()

18 /data/www/html/wiki/includes/MediaWiki.php(322): MediaWiki->performAction()

19 /data/www/html/wiki/includes/MediaWiki.php(904): MediaWiki->performRequest()

20 /data/www/html/wiki/includes/MediaWiki.php(562): MediaWiki->main()

21 /data/www/html/wiki/index.php(50): MediaWiki->run()

22 /data/www/html/wiki/index.php(46): wfIndexMain()

23 {main}

Product Version [MediaWiki] 1.39.4 [PHP] 8.0.25 (apache2handler) [MySQL] 8.0.26

Semantic MediaWiki | 4.1.1 | Maps | 10.0.0 |

I am not sure why its throwing this error since all the required extensions and libs are installed (as per my knowledge). anybody knows why this behavior?

Thanks in advance... Vishnu

malberts commented 1 year ago

ParamProcessor is part of a Composer dependency and should've been downloaded when running composer update. How did you install Maps?

vgangt commented 1 year ago

Hi @malberts , I added these two lines in require section of composer.json and run composer update no-dev (as suggested in the extension doc) "mediawiki/semantic-media-wiki": "4.1.1", "mediawiki/maps": "^10.0" Then added, below lines in Localsettings.php and after that, executed update.php script wfLoadExtension( 'SemanticMediaWiki'); wfLoadExtension( 'Maps' );

I believe the paramprocessor got installed automatically as dependency... and what I tried is correct method. But I dont understand why its not working...

-- Vishnu.

vgangt commented 1 year ago

Hi, I cloned the paramprocessor codes (https://github.com/JeroenDeDauw/ParamProcessor.git) manually to the extension folder and added in LocalSettings.php, require_once( "$IP/extensions/ParamProcessor/src/Processor.php" ); require_once( "$IP/extensions/ParamProcessor/src/ParamDefinitionFactory.php" );

Now this error is gone atleast when default service is googlemaps3... But still the map is not loading properly, it just showing in middle of Atlantic Sea. :)

When setting defaul service as leaflet, the error is there.. Call to undefined method ParamProcessor\ProcessingResult::getParameterArray()

Backtrace:

from /data/www/html/wiki/extensions/Maps/src/LeafletService.php(222)

0 /data/www/html/wiki/extensions/Maps/src/Map/DisplayMap/DisplayMapFunction.php(65): Maps\LeafletService->newMapDataFromProcessingResult()

1 /data/www/html/wiki/extensions/Maps/src/ParserHookSetup.php(80): Maps\Map\DisplayMap\DisplayMapFunction->getMapHtmlForKeyValueStrings()

2 /data/www/html/wiki/extensions/Maps/src/ParserHookSetup.php(58): Maps\ParserHookSetup->handleFunctionHook()

3 /data/www/html/wiki/includes/parser/Parser.php(3437): Maps\ParserHookSetup->Maps{closure}()

4 /data/www/html/wiki/includes/parser/Parser.php(3122): Parser->callParserFunction()

5 /data/www/html/wiki/includes/parser/PPFrame_Hash.php(275): Parser->braceSubstitution()

6 /data/www/html/wiki/extensions/Maps/src/ParserHookSetup.php(82): PPFrame_Hash->expand()

7 [internal function]: Maps\ParserHookSetup->Maps{closure}()

8 /data/www/html/wiki/extensions/Maps/src/ParserHookSetup.php(81): array_map()

9 /data/www/html/wiki/extensions/Maps/src/ParserHookSetup.php(58): Maps\ParserHookSetup->handleFunctionHook()

10 /data/www/html/wiki/includes/parser/Parser.php(3437): Maps\ParserHookSetup->Maps{closure}()

11 /data/www/html/wiki/includes/parser/Parser.php(3122): Parser->callParserFunction()

12 /data/www/html/wiki/includes/parser/PPFrame_Hash.php(275): Parser->braceSubstitution()

13 /data/www/html/wiki/includes/parser/Parser.php(2951): PPFrame_Hash->expand()

14 /data/www/html/wiki/includes/parser/Parser.php(1609): Parser->replaceVariables()

15 /data/www/html/wiki/includes/parser/Parser.php(723): Parser->internalParse()

16 /data/www/html/wiki/includes/content/WikitextContentHandler.php(301): Parser->parse()

17 /data/www/html/wiki/includes/content/ContentHandler.php(1721): WikitextContentHandler->fillParserOutput()

18 /data/www/html/wiki/includes/content/Renderer/ContentRenderer.php(47): ContentHandler->getParserOutput()

19 /data/www/html/wiki/includes/Revision/RenderedRevision.php(266): MediaWiki\Content\Renderer\ContentRenderer->getParserOutput()

20 /data/www/html/wiki/includes/Revision/RenderedRevision.php(237): MediaWiki\Revision\RenderedRevision->getSlotParserOutputUncached()

21 /data/www/html/wiki/includes/Revision/RevisionRenderer.php(221): MediaWiki\Revision\RenderedRevision->getSlotParserOutput()

22 /data/www/html/wiki/includes/Revision/RevisionRenderer.php(158): MediaWiki\Revision\RevisionRenderer->combineSlotOutput()

23 [internal function]: MediaWiki\Revision\RevisionRenderer->MediaWiki\Revision{closure}()

24 /data/www/html/wiki/includes/Revision/RenderedRevision.php(199): call_user_func()

25 /data/www/html/wiki/includes/poolcounter/PoolWorkArticleView.php(91): MediaWiki\Revision\RenderedRevision->getRevisionParserOutput()

26 /data/www/html/wiki/includes/poolcounter/PoolWorkArticleViewCurrent.php(97): PoolWorkArticleView->renderRevision()

27 /data/www/html/wiki/includes/poolcounter/PoolCounterWork.php(162): PoolWorkArticleViewCurrent->doWork()

28 /data/www/html/wiki/includes/page/ParserOutputAccess.php(299): PoolCounterWork->execute()

29 /data/www/html/wiki/includes/page/Article.php(714): MediaWiki\Page\ParserOutputAccess->getParserOutput()

30 /data/www/html/wiki/includes/page/Article.php(528): Article->generateContentOutput()

31 /data/www/html/wiki/includes/actions/ViewAction.php(78): Article->view()

32 /data/www/html/wiki/includes/MediaWiki.php(542): ViewAction->show()

33 /data/www/html/wiki/includes/MediaWiki.php(322): MediaWiki->performAction()

34 /data/www/html/wiki/includes/MediaWiki.php(904): MediaWiki->performRequest()

35 /data/www/html/wiki/includes/MediaWiki.php(562): MediaWiki->main()

36 /data/www/html/wiki/index.php(50): MediaWiki->run()

37 /data/www/html/wiki/index.php(46): wfIndexMain()

38 {main}

Thanks, Vishnu

vgangt commented 1 year ago

Hi, for the above error, adding below line helped. require_once( "$IP/extensions/ParamProcessor/src/Processor.php" ); require_once( "$IP/extensions/ParamProcessor/src/ParamDefinitionFactory.php" ); require_once( "$IP/extensions/ParamProcessor/src/ProcessingResult.php" );

Thanks Vishnu