evoWeb / store_finder

Store finder extension for TYPO3
GNU General Public License v2.0
2 stars 9 forks source link

PHP Fatal Error, if Google Geolocation Service Request fails #4

Closed sfsmfc closed 6 years ago

sfsmfc commented 7 years ago

We get a PHP Fatal Error, if the geolocate service is not available or the request fails.

The problem is, that Evoweb\StoreFinder\Domain\Repository\LocationRepository::findByConstraint delivers an array, if the constraint is not geolocated. But the function should deliver an \TYPO3\CMS\Extbase\Persistence\QueryResultInterface and not an array. Therefore we call ->count() on an array and this is not definded (e.g. \Evoweb\StoreFinder\Controller\MapController::mapAction line 114)

Solution is to return a query without result instead of an array or to check before the count function, if we have an \TYPO3\CMS\Extbase\Persistence\QueryResultInterface.

sfsmfc commented 7 years ago

Solved in https://github.com/evoWeb/store_finder/pull/6

garbast commented 6 years ago

Merged