From 84cfe5db530707c0efbb6436c4d1f21cb1fdc5ee Mon Sep 17 00:00:00 2001 From: Sarah Hoffmann Date: Wed, 22 Aug 2018 22:35:46 +0200 Subject: [PATCH] fix warning in keyword output of details --- lib/template/details-html.php | 14 ++++++++------ test/bdd/api/details/params.feature | 13 +++++++++++++ 2 files changed, 21 insertions(+), 6 deletions(-) diff --git a/lib/template/details-html.php b/lib/template/details-html.php index 328786e2..01583e5f 100644 --- a/lib/template/details-html.php +++ b/lib/template/details-html.php @@ -177,18 +177,20 @@ } } - - 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']); + } } } diff --git a/test/bdd/api/details/params.feature b/test/bdd/api/details/params.feature index a0b990eb..3c9286ed 100644 --- a/test/bdd/api/details/params.feature +++ b/test/bdd/api/details/params.feature @@ -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 + | keywords | + | 1 | + Then the result is valid html + + Examples: + | osmid | + | W78099902 | + | N3121929846 | + + -- 2.39.5