FriendsOfTYPO3 / tt_address

Add address / contact datasets to your content management system.
GNU General Public License v2.0
40 stars 76 forks source link

Nominatim API no longer accessible via this URL, TYPO3 v11, tt_address v8.0.1 #507

Closed obusch14v closed 10 months ago

obusch14v commented 1 year ago

Bug Report

Current Behavior

If we try to drag the coordinates via Nominatim in an address in the backend via the LocationMapWizard, we get the error message in the console

File not found: API no longer accessible via this URL

Using the URL /search/ and /reverse/ (with slashes) is no longer supported. Please use URLs as given in the documentation.

Examples how to change the URL:

You use: https://nominatim.openstreetmap.org/search/?q=Berlin
Change to: https://nominatim.openstreetmap.org/search?q=Berlin

You use: https://nominatim.openstreetmap.org/search/US/Texas/Huston
Change to: https://nominatim.openstreetmap.org/search?q=Huston, Texas, US

See [github issue #3134](https://github.com/osm-search/Nominatim/issues/3134) for more details.

Environment

Our quick and dirty fix

File: tt_address/Classes/FormEngine/FieldControl/LocationMapWizard.php Lines 49ff

if ($address) {
    // base url
    //                $geoCodeUrlBase = 'https://nominatim.openstreetmap.org/search/'; => Changed to
    $geoCodeUrlBase = 'https://nominatim.openstreetmap.org/search?q=';
    $geoCodeUrlAddress = $address;
    $geoCodeUrlCityOnly = ($row['city'] ?? '');
    // urlparams for nominatim which are fixed.
    //                $geoCodeUrlQuery = '?format=json&addressdetails=1&limit=1&polygon_svg=1'; => Changed to
    $geoCodeUrlQuery = '&format=json&addressdetails=1&limit=1&polygon_svg=1';
    // replace newlines with spaces; remove multiple spaces
    $geoCodeUrl = trim(preg_replace('/\s\s+/', ' ', $geoCodeUrlBase . $geoCodeUrlAddress . $geoCodeUrlQuery));
    $geoCodeUrlShort = trim(preg_replace('/\s\s+/', ' ', $geoCodeUrlBase . $geoCodeUrlCityOnly . $geoCodeUrlQuery));
}
Patta commented 1 year ago

already fixed in master #501

WSBusch commented 1 year ago

Ah ok. Thank you. Then it just hasn't been updated in the TER yet.