]> git.openstreetmap.org Git - nominatim.git/commitdiff
place lookup: filter places that have no details
authorSarah Hoffmann <lonvia@denofr.de>
Thu, 27 Aug 2020 07:33:21 +0000 (09:33 +0200)
committerSarah Hoffmann <lonvia@denofr.de>
Thu, 27 Aug 2020 07:33:21 +0000 (09:33 +0200)
In rare cases search_name might have entries for places for
which we do not return details, in particular for linkees.
Need to remove those entries in the result list before returning
the details.

Fixes #1932.

lib/PlaceLookup.php

index 0a285a6a78b69ab7b5b9f16c8493a7f1c22718bb..a2f39ea348ba466e21111a1e6f65395eb8343f57 100644 (file)
@@ -456,6 +456,13 @@ class PlaceLookup
             $aResults[$aPlace['place_id']] = $aPlace;
         }
 
             $aResults[$aPlace['place_id']] = $aPlace;
         }
 
+        $aResults = array_filter(
+            $aResults,
+            function ($v) {
+                return !($v instanceof Result);
+            }
+        );
+
         Debug::printVar('Places', $aResults);
 
         return $aResults;
         Debug::printVar('Places', $aResults);
 
         return $aResults;