Skip to content

Commit b16c9a6

Browse files
cconard96cedric-anne
authored andcommitted
must declare config js vars directly on window
1 parent 13b4209 commit b16c9a6

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/Glpi/Application/View/Extension/FrontEndAssetsExtension.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -295,9 +295,9 @@ public function configJs(): string
295295

296296
$plugins_path = \array_map(fn(string $plugin_key) => "/plugins/{$plugin_key}", Plugin::getPlugins());
297297

298-
$script = sprintf('const CFG_GLPI = %s;', json_encode($cfg_glpi, JSON_PRETTY_PRINT))
298+
$script = sprintf('window.CFG_GLPI = %s;', json_encode($cfg_glpi, JSON_PRETTY_PRINT))
299299
. "\n"
300-
. sprintf('const GLPI_PLUGINS_PATH = %s;', json_encode($plugins_path, JSON_PRETTY_PRINT));
300+
. sprintf('window.GLPI_PLUGINS_PATH = %s;', json_encode($plugins_path, JSON_PRETTY_PRINT));
301301

302302
return Html::scriptBlock($script);
303303
}

0 commit comments

Comments
 (0)