JcDenis / DotclearWatch

Dotclear plugin - Dotclear statistics around the world
https://dotclear.watch
GNU General Public License v2.0
0 stars 1 forks source link

Erreur d'exécution lorsqu'aucun thème d'interface n'est défini dans la config #3

Closed manusauvage closed 1 year ago

manusauvage commented 1 year ago

[contexte: sur un blog en 2.27.1, installé il y a très longtemps en 2.0, puis migré au fur et à mesure des patches]

Après installation du plugin, la configuration me renvoyait vers une page non habillée, et non fonctionnelle. Le plugin levait alors l'exception suivante :

2023/08/16 09:38:35 [error] 1408600#1408600: *11361 FastCGI sent in stderr: "PHP message: PHP Fatal error:  Uncaught TypeError: Dotclear\Core\Backend\Page::jsRunCodeMirror(): Argument #4 ($theme) must be
of type string, null given, called in plugins/DotclearWatch/src/Config.php on line 142 and defined in src/Core/Backend/Page.php:1272
Stack trace:
#0 plugins/DotclearWatch/src/Config.php(142): Dotclear\Core\Backend\Page::jsRunCodeMirror()
#1 src/Core/Backend/ModulesList.php(1738): Dotclear\Plugin\DotclearWatch\Config::render()
#2 src/Process/Backend/Plugins.php(312): Dotclear\Core\Backend\ModulesList->includeConfiguration()
#3 src/Process/Backend/Plugins.php(58): Dotclear\Process\Backend\Plugins::renderConfig()
#4 src/App.php(98): Dotclear\Process\Backend\Plugins::init()
#5 src/App.php(75): Dotclear\App::process()
#6 admin/index.php(16): Dotclear\App::bootstrap()
#7 {main}
  thrown in [path] while reading response header from upstream, client: XX.XXX.XX.XXX, server: xxxx.xxxxxxxxx.xxx, request: "GET /admin/index.php?process=Plugins&module=DotclearWatch&conf=1 HTTP/
1.1", upstream: "fastcgi://unix:/run/php/php-fpm.sock:", host: "xxxx.xxxxxxxxx.xxx", referrer: "xxxx.xxxxxxxxx.xxx"

J'ai résolu le problème en allant dans "mes préférences -> mes options" (admin/index.php?process=UserPreferences#user-options), en sélectionnant un thème d'interface (clair|sombre|automatique) et en enregistrant les préférences.

A priori, cette valeur n'était pas renseignée dans ma configuration, ce qui générait une erreur dans le code appelé par le plugin. J'avoue ne pas avoir fouillé plus loin à ce stade.

JcDenis commented 1 year ago

Effectivement je ne test pas sa présence, ce sera corrigé. Merci pour ce retour

JcDenis commented 1 year ago

Normalement corrigé en 0.7.2