From b3caac45b12a23e4289d00133d2ad7915d084c44 Mon Sep 17 00:00:00 2001 From: Yassine Doghri <yassine@doghri.fr> Date: Wed, 22 Sep 2021 15:07:18 +0000 Subject: [PATCH] fix(map): update episode markers query to discard unpublished episodes --- app/Controllers/MapMarkerController.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/app/Controllers/MapMarkerController.php b/app/Controllers/MapMarkerController.php index 4d862757c6..6c6df82d80 100644 --- a/app/Controllers/MapMarkerController.php +++ b/app/Controllers/MapMarkerController.php @@ -10,7 +10,6 @@ declare(strict_types=1); namespace App\Controllers; -use App\Entities\Page; use App\Models\EpisodeModel; use CodeIgniter\HTTP\ResponseInterface; @@ -34,7 +33,9 @@ class MapMarkerController extends BaseController { $cacheName = 'episodes_markers'; if (! ($found = cache($cacheName))) { - $episodes = (new EpisodeModel())->where('location_geo is not', null) + $episodes = (new EpisodeModel()) + ->where('`published_at` <= NOW()', null, false) + ->where('location_geo is not', null) ->findAll(); $found = []; foreach ($episodes as $episode) { -- GitLab