Skip to content

Commit

Permalink
Fix debug setting
Browse files Browse the repository at this point in the history
  • Loading branch information
Alexander Bigga committed Apr 5, 2021
1 parent fae4492 commit 637adc0
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions Classes/Div.php
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ public static function searchAddress(&$address, $service = 0)
$country = strtoupper(strlen($address['country']) == 2 ? $address['country'] : $config['default_country']);
$email = GeneralUtility::validEmail($config['geo_service_email']) ? $config['geo_service_email'] : $_SERVER['SERVER_ADMIN'];

if ($GLOBALS['TYPO3_CONF_VARS']['FE']['debug']) {
if ($GLOBALS['TYPO3_CONF_VARS']['BE']['debug']) {
$service_names = array(0 => 'cache', 1 => 'geonames', 2 => 'nominatim');
self::getLogger()->debug('Search address using ' . $service_names[$service], $address);
}
Expand Down Expand Up @@ -226,7 +226,7 @@ public static function searchAddress(&$address, $service = 0)

if ($result) {
if ($result['status']) {
if ($GLOBALS['TYPO3_CONF_VARS']['FE']['debug']) {
if ($GLOBALS['TYPO3_CONF_VARS']['BE']['debug']) {
self::getLogger()->debug('GeoNames message', (array)$result['status']['message']);
}
self::flashMessage(
Expand Down Expand Up @@ -278,15 +278,15 @@ public static function searchAddress(&$address, $service = 0)
$query['street'] = $address['housenumber'] . ' ' . $query['street'];
}

if ($GLOBALS['TYPO3_CONF_VARS']['FE']['debug']) {
if ($GLOBALS['TYPO3_CONF_VARS']['BE']['debug']) {
self::getLogger()->debug('Nominatim structured', $query);
}
$ll = self::searchAddressNominatim($query, $address);

if (!$ll && $query['postalcode']) {
unset($query['postalcode']);

if ($GLOBALS['TYPO3_CONF_VARS']['FE']['debug']) {
if ($GLOBALS['TYPO3_CONF_VARS']['BE']['debug']) {
self::getLogger()->debug('Nominatim retrying without zip', $query);
}
$ll = self::searchAddressNominatim($query, $address);
Expand All @@ -296,15 +296,15 @@ public static function searchAddress(&$address, $service = 0)
if ($address['type'] == 'unstructured') {
$query['q'] = $address['address'];

if ($GLOBALS['TYPO3_CONF_VARS']['FE']['debug']) {
if ($GLOBALS['TYPO3_CONF_VARS']['BE']['debug']) {
self::getLogger()->debug('Nominatim unstructured', $query);
}
$ll = self::searchAddressNominatim($query, $address);
}
break;
}

if ($GLOBALS['TYPO3_CONF_VARS']['FE']['debug']) {
if ($GLOBALS['TYPO3_CONF_VARS']['BE']['debug']) {
if ($ll) {
self::getLogger()->debug('Return address', $address);
} else {
Expand Down

0 comments on commit 637adc0

Please sign in to comment.