netzmacht / contao-leaflet-maps

Leaflet maps extension for Contao CMS
12 stars 8 forks source link

Fix undefined global variable `$LEAFLET_LIBRARIES` #120

Closed fritzmg closed 1 year ago

fritzmg commented 1 year ago

Fixes the following error that happens during cache:warmup under Contao 4.13 and PHP 8:

In LibrariesConfiguration.php line 52:

  [ErrorException]
  Warning: Undefined global variable $LEAFLET_LIBRARIES  

Exception trace:
  at vendor\netzmacht\contao-leaflet-maps\src\Frontend\Assets\LibrariesConfiguration.php:52
 Netzmacht\Contao\Leaflet\Frontend\Assets\LibrariesConfiguration->getIterator() at vendor\netzmacht\contao-leaflet-maps\src\Listener\RegisterLibrariesListener.php:61
 Netzmacht\Contao\Leaflet\Listener\RegisterLibrariesListener->onInitializeSystem() at vendor\contao\contao\core-bundle\src\Framework\ContaoFramework.php:405
 Contao\CoreBundle\Framework\ContaoFramework->triggerInitializeSystemHook() at vendor\contao\contao\core-bundle\src\Framework\ContaoFramework.php:307

Not sure what the original intention with this global was - but for simplicity I decided to let it get initialized in Contao's config.php.