netzmacht / contao-leaflet-maps

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

icons.js missing, when not using icons at all #44

Closed taleteller closed 7 years ago

taleteller commented 7 years ago

Trying to load a map in the frontend, containing no "Icon" results in this error:

Warning: filemtime(): stat failed for /var/customers/webs/moarhof/assets/leaflet/js/icons.js in system/modules/core/library/Contao/Controller.php on line 857

#0 [internal function]: __error(2, 'filemtime(): st...', '/var/customers/...', 857, Array)
#1 system/modules/core/library/Contao/Controller.php(857): filemtime('/var/customers/...')
#2 system/modules/core/classes/FrontendTemplate.php(102): Contao\Controller::replaceDynamicScriptTags('...')
#3 system/modules/core/pages/PageRegular.php(190): Contao\FrontendTemplate->output(true)
#4 system/modules/core/controllers/FrontendIndex.php(285): Contao\PageRegular->generate(Object(Contao\PageModel), true)
#5 index.php(20): Contao\FrontendIndex->run()
#6 {main}

Fatal error: Uncaught exception Exception with message File assets/leaflet/js/icons.js does not exist thrown in system/modules/core/library/Contao/Combiner.php on line 139

#0 system/modules/core/library/Contao/Controller.php(860): Contao\Combiner->add('assets/leaflet/...', false)
#1 system/modules/core/classes/FrontendTemplate.php(102): Contao\Controller::replaceDynamicScriptTags('...')
#2 system/modules/core/pages/PageRegular.php(190): Contao\FrontendTemplate->output(true)
#3 system/modules/core/controllers/FrontendIndex.php(285): Contao\PageRegular->generate(Object(Contao\PageModel), true)
#4 index.php(20): Contao\FrontendIndex->run()
#5 {main}

Adding an dummy icon to the map, removes the error and loads the map as intent, because a icons.js gets generated. Obviously loading the asset should be skipped when there is no need. Additionally I noticed the icons.js not being deleted or emptied when removing the last Icon from Backend. Therefore if you ever added and removed an Icon the error above will never appear.