Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
obusch14v opened this issue Nov 8, 2023 · 2 comments

Comments

@obusch14v
Copy link

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

  • TYPO3 version: 11.5.32
  • tt_address version: 8.0.1

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
Copy link
Contributor

Patta commented Nov 8, 2023

already fixed in master #501

@WSBusch
Copy link

WSBusch commented Nov 8, 2023

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants