From be9b6799221953fc6c9cf4833ada138f12065bfc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=BCrgen=20Mummert?= Date: Sat, 27 Dec 2025 21:33:32 +0100 Subject: [PATCH] Bugfix --- src/Service/MeilisearchIndexService.php | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/src/Service/MeilisearchIndexService.php b/src/Service/MeilisearchIndexService.php index fb41d7a..cda0435 100644 --- a/src/Service/MeilisearchIndexService.php +++ b/src/Service/MeilisearchIndexService.php @@ -101,12 +101,20 @@ class MeilisearchIndexService } foreach ($data as $entry) { - if ( - ($entry['@type'] ?? null) === 'https://schema.org/Event' - && !empty($entry['startDate']) - ) { - $timestamp = strtotime($entry['startDate']); - return $timestamp ?: null; + if (($entry['@type'] ?? null) !== 'https://schema.org/Event') { + continue; + } + + // ✅ Contao-JSON-LD (vollqualifiziert) + if (!empty($entry['https://schema.org/startDate'])) { + $ts = strtotime($entry['https://schema.org/startDate']); + return $ts ?: null; + } + + // 🛟 Fallback (falls Contao das irgendwann ändert) + if (!empty($entry['startDate'])) { + $ts = strtotime($entry['startDate']); + return $ts ?: null; } }