]> git.openstreetmap.org Git - nominatim.git/commitdiff
Merge remote-tracking branch 'upstream/master'
authorSarah Hoffmann <lonvia@denofr.de>
Sat, 30 Sep 2017 10:25:41 +0000 (12:25 +0200)
committerSarah Hoffmann <lonvia@denofr.de>
Sat, 30 Sep 2017 10:25:41 +0000 (12:25 +0200)
lib/Geocode.php
lib/lib.php

index 20749fffe0e860cd74c363f3f5fc4692b401e841..cff70efc4832794ee0229fc9ff356516aa8e1888 100644 (file)
@@ -752,7 +752,7 @@ class Geocode
                                 } elseif ($sPhraseType == 'postalcode' || ($aSearchTerm['class'] == 'place' && $aSearchTerm['type'] == 'postcode')) {
                                     // We need to try the case where the postal code is the primary element (i.e. no way to tell if it is (postalcode, city) OR (city, postalcode) so try both
                                     if ($aSearch['sPostcode'] === '' && $aSearch['sHouseNumber'] === '' &&
-                                        isset($aSearchTerm['word_id']) && $aSearchTerm['word_id'] && strpos($sNormQuery, $this->normTerm($aSearchTerm['word'])) !== false) {
+                                        isset($aSearchTerm['word']) && $aSearchTerm['word'] && strpos($sNormQuery, $this->normTerm($aSearchTerm['word'])) !== false) {
                                         // If we have structured search or this is the first term,
                                         // make the postcode the primary search element.
                                         if ($aSearch['sOperator'] === '' && ($sPhraseType == 'postalcode' || ($iToken == 0 && $iPhrase == 0))) {
index b7564c7f7b42e70e8b6b4b2c2fde805b69bc9a13..8a49761b638636b6f8919c2bb4fb7d3d3c1d9c30 100644 (file)
@@ -545,8 +545,12 @@ function _debugDumpGroupedSearches($aData, $aTokens)
             echo "<td>".$aRow['sPostcode']."</td>";
             echo "<td>".$aRow['sHouseNumber']."</td>";
 
-            echo "<td>".$aRow['oNear']->lat()."</td>";
-            echo "<td>".$aRow['oNear']->lon()."</td>";
+            if ($aRow['oNear']) {
+                echo "<td>".$aRow['oNear']->lat()."</td>";
+                echo "<td>".$aRow['oNear']->lon()."</td>";
+            } else {
+                echo "<td></td><td></td>";
+            }
             echo "<td>".$aRow['fRadius']."</td>";
 
             echo "</tr>";