From 11cd64869936acea5d95a688b554e4bebaa5fec1 Mon Sep 17 00:00:00 2001 From: Sarah Hoffmann Date: Wed, 8 Apr 2020 11:12:27 +0200 Subject: [PATCH] remove name from geocodejson when not set --- lib/template/address-geocodejson.php | 4 +++- lib/template/search-geocodejson.php | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/lib/template/address-geocodejson.php b/lib/template/address-geocodejson.php index 98c368b3..0066e80e 100644 --- a/lib/template/address-geocodejson.php +++ b/lib/template/address-geocodejson.php @@ -30,7 +30,9 @@ if (empty($aPlace)) { $aFilteredPlaces['properties']['geocoding']['label'] = $aPlace['langaddress']; - $aFilteredPlaces['properties']['geocoding']['name'] = $aPlace['placename']; + if ($aPlace['placename'] !== null) { + $aFilteredPlaces['properties']['geocoding']['name'] = $aPlace['placename']; + } if (isset($aPlace['address'])) { $aPlace['address']->addGeocodeJsonAddressParts( diff --git a/lib/template/search-geocodejson.php b/lib/template/search-geocodejson.php index dfb402bd..3e3a31c4 100644 --- a/lib/template/search-geocodejson.php +++ b/lib/template/search-geocodejson.php @@ -20,7 +20,9 @@ foreach ($aSearchResults as $iResNum => $aPointDetails) { $aPlace['properties']['geocoding']['label'] = $aPointDetails['langaddress']; - $aPlace['properties']['geocoding']['name'] = $aPointDetails['placename']; + if ($aPointDetails['placename'] !== null) { + $aPlace['properties']['geocoding']['name'] = $aPointDetails['placename']; + } if (isset($aPointDetails['address'])) { $aPointDetails['address']->addGeocodeJsonAddressParts(