SemanticMediaWiki / Mermaid

Provides a parser function to generate diagrams and flowcharts with the help of the mermaid script language
https://www.mediawiki.org/wiki/Extension:Mermaid
Other
36 stars 24 forks source link

$mermaidgDefaultTheme config variable is ignored #74

Open ernstki opened 3 years ago

ernstki commented 3 years ago

Setup and configuration

Issue

The config variable $mermaidgDefaultTheme is ignored, as is config.DefaultTheme.value from extension.json; Mermaid\Config::getDefaultTheme() always returns forest no matter what.

Well, it always returns forest unless you modify it to return something else like default or neutral, or hard-code the theme value at MermaidParserFunction.php line 80.

Steps to reproduce the observation:

Amplifying information

Step-debugging through src/Config.php reveals that $this->globalConfig is basically empty (at line 21) when Mermaid\Config::getDefaultTheme() is invoked from within Mermaid\MermaidParserFunction::parse (at line 80).

Bildschirmfoto 2021-09-25 um 10 19 38_thumb

I assume this was meant to contain something, maybe settings from the config section of extension.json, or variables configured in LocalSettings.php, but it's beyond my level of understanding at the present moment to exactly surmise what or why.

ernstki commented 3 years ago

I can help with this if @howlowck wouldn't mind just giving me a shove in the right direction, as far as what was intended there in src/Config.php.

wobbba commented 2 years ago

Any updates on this?

EDIT: for anyone else encountering this problem: it gets cached, gotta update the chart to see changes, hardcoding in Config.php works