Mermaid icon indicating copy to clipboard operation
Mermaid copied to clipboard

$mermaidgDefaultTheme config variable is ignored

Open ernstki opened this issue 3 years ago • 2 comments

Setup and configuration

  • Mermaid version: 3.0.1
  • MediaWiki version: 1.35.3
  • PHP version: 7.3.x
  • Database system (MySQL, PostgresQL, etc.) and version: MySQL 5.7.x

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:

  • install Mermaid as per INSTALL.md
  • change $mermaidgDefaultTheme to something other than forest, as per INSTALL.md#configuration

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 avatar Sep 25 '21 14:09 ernstki

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.

ernstki avatar Sep 25 '21 14:09 ernstki

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

wobbba avatar Nov 02 '22 21:11 wobbba