From cbed6488c6fac66f518de8206d5db0c70ebd5306 Mon Sep 17 00:00:00 2001 From: jygaulier Date: Tue, 3 Jul 2018 17:32:22 +0200 Subject: [PATCH] PHRAS-2126_Array-to-String-err-idx_4.1 (#2658) * PHRAS-2126_Array-to-String-err-idx_4.1 fix : es error message during indexation is now dumped (not always a string) fix : es file "size" is now type "long" * PHRAS-2126_Array-to-String-err-idx_4.1 fix : bad gps coordinate are ignored by es indexation. * PHRAS-2126_Array-to-String-err-idx_4.1 fix : gps coordinate can de negative. --- .../Elastic/Indexer/Record/Hydrator/GpsPosition.php | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/lib/Alchemy/Phrasea/SearchEngine/Elastic/Indexer/Record/Hydrator/GpsPosition.php b/lib/Alchemy/Phrasea/SearchEngine/Elastic/Indexer/Record/Hydrator/GpsPosition.php index 30dc66f936..ba0dcf573f 100644 --- a/lib/Alchemy/Phrasea/SearchEngine/Elastic/Indexer/Record/Hydrator/GpsPosition.php +++ b/lib/Alchemy/Phrasea/SearchEngine/Elastic/Indexer/Record/Hydrator/GpsPosition.php @@ -34,12 +34,18 @@ class GpsPosition switch ($tag_name) { case self::LONGITUDE_TAG_NAME: Assertion::numeric($value); - $this->longitude = (float) $value; + $value = (float) $value; + if($value >= -180.0 && $value <= 180.0 ) { + $this->longitude = $value; + } break; case self::LATITUDE_TAG_NAME: Assertion::numeric($value); - $this->latitude = (float) $value; + $value = (float) $value; + if($value >= -90.0 && $value <= 90.0 ) { + $this->latitude = $value; + } break; case self::LONGITUDE_REF_TAG_NAME: