Skip to content

Commit

Permalink
[BUGFIX] Fix GEO JSON in 5.x (#1399)
Browse files Browse the repository at this point in the history
Co-authored-by: Sebastian Meyer <sebastian.meyer@opencultureconsulting.com>
  • Loading branch information
beatrycze-volk and sebastian-meyer committed Dec 18, 2024
1 parent 37e6746 commit d0db04e
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion Classes/Common/Indexer.php
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit d0db04e

Please sign in to comment.