forked from Snck3rs/contao-leaflet-maps
Prevent cacheKey is not set.
This commit is contained in:
@@ -45,7 +45,8 @@
|
|||||||
},
|
},
|
||||||
"require-dev": {
|
"require-dev": {
|
||||||
"phpcq/all-tasks": "^1.2",
|
"phpcq/all-tasks": "^1.2",
|
||||||
"contao/manager-plugin": "^2.1"
|
"contao/manager-plugin": "^2.1",
|
||||||
|
"phpstan/phpstan": "^0.10.3"
|
||||||
},
|
},
|
||||||
"autoload": {
|
"autoload": {
|
||||||
"psr-4": {
|
"psr-4": {
|
||||||
|
|||||||
@@ -206,7 +206,10 @@ class MapProvider
|
|||||||
$model = $this->getModel($mapId);
|
$model = $this->getModel($mapId);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($model->cache) {
|
$cacheKey = null;
|
||||||
|
$doCache = $model->cache;
|
||||||
|
|
||||||
|
if ($doCache) {
|
||||||
$cacheKey = $this->getCacheKey($mapId, $filter, $elementId, $template, $style);
|
$cacheKey = $this->getCacheKey($mapId, $filter, $elementId, $template, $style);
|
||||||
|
|
||||||
if ($this->cache->contains($cacheKey)) {
|
if ($this->cache->contains($cacheKey)) {
|
||||||
@@ -219,7 +222,7 @@ class MapProvider
|
|||||||
|
|
||||||
$buffer = $this->doGenerate($model, $filter, $elementId, $template, $style);
|
$buffer = $this->doGenerate($model, $filter, $elementId, $template, $style);
|
||||||
|
|
||||||
if ($model->cache) {
|
if ($doCache) {
|
||||||
$this->cache->save(
|
$this->cache->save(
|
||||||
$cacheKey,
|
$cacheKey,
|
||||||
[
|
[
|
||||||
|
|||||||
Reference in New Issue
Block a user