This commit is contained in:
Jürgen Mummert
2025-12-27 21:33:32 +01:00
parent 76e081e51e
commit be9b679922
+14 -6
View File
@@ -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;
}
}