mirror of
https://github.com/netzmacht/contao-leaflet-maps.git
synced 2025-11-29 03:24:37 +01:00
Fix #75: A non existing image of an image icon throws an exception.
This commit is contained in:
@@ -12,6 +12,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|||||||
|
|
||||||
- Fix ordering changes in layer control element aren't recognized ([#72](https://github.com/netzmacht/contao-leaflet-maps/issues/72))
|
- Fix ordering changes in layer control element aren't recognized ([#72](https://github.com/netzmacht/contao-leaflet-maps/issues/72))
|
||||||
- Fix markers with negative coordinates aren't displayed ([#74](https://github.com/netzmacht/contao-leaflet-maps/issues/74))
|
- Fix markers with negative coordinates aren't displayed ([#74](https://github.com/netzmacht/contao-leaflet-maps/issues/74))
|
||||||
|
- Fix image icon with non existing image throws exception ([#75])(https://github.com/netzmacht/contao-leaflet-maps/issues/75))
|
||||||
|
|
||||||
## [3.1.3] - 2019-01-10
|
## [3.1.3] - 2019-01-10
|
||||||
|
|
||||||
|
|||||||
@@ -72,15 +72,9 @@ class ImageIconMapper extends AbstractIconMapper
|
|||||||
$elementId = null
|
$elementId = null
|
||||||
) {
|
) {
|
||||||
$arguments = parent::buildConstructArguments($model, $mapper, $request, $elementId);
|
$arguments = parent::buildConstructArguments($model, $mapper, $request, $elementId);
|
||||||
|
|
||||||
if ($model->iconImage) {
|
|
||||||
$repository = $this->repositoryManager->getRepository(FilesModel::class);
|
$repository = $this->repositoryManager->getRepository(FilesModel::class);
|
||||||
$file = $repository->findByUuid($model->iconImage);
|
$file = $repository->findByUuid($model->iconImage);
|
||||||
|
$arguments[] = $file ? $file->path : '';
|
||||||
if ($file) {
|
|
||||||
$arguments[] = $file->path;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return $arguments;
|
return $arguments;
|
||||||
}
|
}
|
||||||
@@ -117,8 +111,6 @@ class ImageIconMapper extends AbstractIconMapper
|
|||||||
$file = $repository->findByUuid($model->iconImage);
|
$file = $repository->findByUuid($model->iconImage);
|
||||||
|
|
||||||
if ($file) {
|
if ($file) {
|
||||||
$definition->setIconUrl($file->path);
|
|
||||||
|
|
||||||
$file = new File($file->path);
|
$file = new File($file->path);
|
||||||
$definition->setIconSize([$file->width, $file->height]);
|
$definition->setIconSize([$file->width, $file->height]);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user