]> git.openstreetmap.org Git - nominatim.git/commitdiff
fix warning in keyword output of details
authorSarah Hoffmann <lonvia@denofr.de>
Wed, 22 Aug 2018 20:35:46 +0000 (22:35 +0200)
committerSarah Hoffmann <lonvia@denofr.de>
Wed, 22 Aug 2018 20:35:46 +0000 (22:35 +0200)
lib/template/details-html.php
test/bdd/api/details/params.feature

index 328786e28ae04490f87a1f0a997d7ba9829a5179..01583e5f789499a27a28dbdb4d9e3048c72b761e 100644 (file)
         }
     }
 
-
-
     if ($bIncludeKeywords)
     {
         headline('Name Keywords');
-        foreach ($aPlaceSearchNameKeywords as $aRow) {
-            _one_keyword_row($aRow['word_token'], $aRow['word_id']);
+        if ($aPlaceSearchNameKeywords) {
+            foreach ($aPlaceSearchNameKeywords as $aRow) {
+                _one_keyword_row($aRow['word_token'], $aRow['word_id']);
+            }
         }
 
         headline('Address Keywords');
-        foreach ($aPlaceSearchAddressKeywords as $aRow) {
-            _one_keyword_row($aRow['word_token'], $aRow['word_id']);
+        if ($aPlaceSearchAddressKeywords) {
+            foreach ($aPlaceSearchAddressKeywords as $aRow) {
+                _one_keyword_row($aRow['word_token'], $aRow['word_id']);
+            }
         }
     }
 
index a0b990ebc14cd90123fc111f13211f0f326d56f0..3c9286ed285acedc3c2c847a04db89a0662889bf 100644 (file)
@@ -41,3 +41,16 @@ Feature: Object details
             | linkedplaces |
             | 1 |
         Then the result is valid json
+
+    Scenario Outline: HTML Details with keywords
+        When sending html details query for <osmid>
+            | keywords |
+            | 1 |
+        Then the result is valid html
+
+    Examples:
+            | osmid |
+            | W78099902 |
+            | N3121929846 |
+
+