Skip to content
Snippets Groups Projects
Commit 7b23fbae authored by Sebastian Castro's avatar Sebastian Castro
Browse files

Fixs images in marker popup

parent 9e8438eb
No related branches found
No related tags found
No related merge requests found
v2.3.1
======
* BUG: Fix using images in marker popup template
v2.3
====
......
......@@ -28,7 +28,9 @@ class ConfigurationMarker
$matches = [];
preg_match_all('/({{\s*[\w_|]*\s*}})/',$this->popupTemplate, $matches);
$newFields = array_map(function($match) {
return explode('|', preg_replace('/[{}\s]/', '', $match))[0];
$fieldName = explode('|', preg_replace('/[{}\s]/', '', $match))[0];
if ($fieldName == "image") $fieldName = "images";
return $fieldName;
}, $matches[0]);
$oldFields = $this->fieldsUsedByTemplate;
......
......@@ -608,6 +608,7 @@ class Element
{
if (property_exists($this,$key)) {
$method = 'get' . ucfirst($key);
if ($key == 'images') $method = 'getImagesUrls';
return $this->$method();
}
else return $this->getCustomProperty($key);
......@@ -1218,6 +1219,13 @@ class Element
return $this->images;
}
public function getImagesUrls()
{
$result = [];
foreach ($this->images as $image) $result[] = $image->getImageUrl();
return $result;
}
/**
* Add potentialDuplicate
*
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment