From d0db04e9dd8ab88605fc649ce68121c4452a5f5e Mon Sep 17 00:00:00 2001 From: Beatrycze Volk Date: Mon, 16 Dec 2024 21:42:20 +0100 Subject: [PATCH] [BUGFIX] Fix GEO JSON in 5.x (#1399) Co-authored-by: Sebastian Meyer --- Classes/Common/Indexer.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Classes/Common/Indexer.php b/Classes/Common/Indexer.php index 587c8e0c8..34d42bfca 100644 --- a/Classes/Common/Indexer.php +++ b/Classes/Common/Indexer.php @@ -332,7 +332,11 @@ protected static function processLogical(Document $document, array $logicalUnit) $solrDoc->setField('restrictions', $metadata['restrictions']); $coordinates = json_decode($metadata['coordinates'][0]); if (is_object($coordinates)) { - $solrDoc->setField('geom', json_encode($coordinates->features[0])); + $feature = (array) $coordinates->features[0]; + $geometry = (array) $feature['geometry']; + krsort($geometry); + $feature['geometry'] = $geometry; + $solrDoc->setField('geom', json_encode($feature)); } $autocomplete = self::processMetadata($document, $metadata, $solrDoc); // Add autocomplete values to index.