delahaye / dlh_googlemaps

Google Maps Extension für Contao
20 stars 26 forks source link

Division by zero #96

Closed operatorone closed 6 years ago

operatorone commented 6 years ago

Hi, ich habe im Frontend eine Fehlermeldung entdeckt, die da lautet:

Warning: Division by zero in system/modules/dlh_googlemaps/classes/Googlemap.php on line 149

0 system/modules/dlh_googlemaps/classes/Googlemap.php(149): __error(2, 'Division by zer...', '/homepages/26/d...', 149, Array)

1 system/modules/dlh_googlemaps/elements/ContentMap.php(91): delahaye\googlemaps\Googlemap::getMapData('1', 'html5', Array)

2 system/modules/core/elements/ContentElement.php(265): delahaye\googlemaps\ContentMap->compile()

3 system/modules/dlh_googlemaps/elements/ContentMap.php(56): Contao\ContentElement->generate()

4 system/modules/core/library/Contao/Controller.php(484): delahaye\googlemaps\ContentMap->generate()

5 system/modules/core/modules/ModuleArticle.php(213): Contao\Controller::getContentElement(Object(Contao\ContentModel), 'main')

6 system/modules/core/modules/Module.php(287): Contao\ModuleArticle->compile()

7 system/modules/core/modules/ModuleArticle.php(67): Contao\Module->generate()

8 system/modules/core/library/Contao/Controller.php(417): Contao\ModuleArticle->generate(false)

9 system/modules/core/library/Contao/Controller.php(277): Contao\Controller::getArticle(Object(Contao\ArticleModel), false, false, 'main')

10 system/modules/core/pages/PageRegular.php(133): Contao\Controller::getFrontendModule('0', 'main')

11 system/modules/core/controllers/FrontendIndex.php(285): Contao\PageRegular->generate(Object(Contao\PageModel), true)

12 index.php(20): Contao\FrontendIndex->run()

13 {main}

Läuft auf einem Contao 3.5.12 dlh_geocode | 1.1.1 | 3 dlh_googlemaps | 2.3.2 | 4

delahaye commented 6 years ago

Das kann ich leider nicht nachstellen. Frag bitte mal im Forum.

trilobit-gmbh commented 6 years ago

This happens if $arrMap['mapSize'][0] is empty which is the case if you're embedding the map with a display size setting like "Proportional | (empty) | 200".

So either the data container should reject empty fields in the first place or the Googlemap class must handle these cases.