Problem in Country Dropdown

Questions around the TYPO3 integration and plugins
Forum rules
Always add your TYPO3, Aimeos and PHP version as well as your environment (Linux/Mac/Win)
Spam and unrelated posts will be removed immediately!
cnoelker
Advanced
Posts: 140
Joined: 20 Feb 2016, 18:21

Problem in Country Dropdown

Post by cnoelker » 02 Nov 2021, 13:19

Hello,
the country dropdown of the customer maintenance does not work anymore. Message in the browser is:

Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at https://restcountries.eu/rest/v2/all?fi ... 2Code;name. (Reason: CORS request did not succeed).

I tried to open the restcountries.eu site, but this doesn't respond, either.

In https://github.com/aimeos/ai-admin-jqad ... s/admin.js , I see that the method getCountries is marked as @deprecated 2022.01

How can I make this working, again?

Claudia

cnoelker
Advanced
Posts: 140
Joined: 20 Feb 2016, 18:21

Re: Problem in Country Dropdown

Post by cnoelker » 02 Nov 2021, 14:23


cnoelker
Advanced
Posts: 140
Joined: 20 Feb 2016, 18:21

Re: Problem in Country Dropdown

Post by cnoelker » 02 Nov 2021, 15:22

I changed this in my local code and it fixes the problem.

User avatar
aimeos
Administrator
Posts: 7866
Joined: 01 Jan 1970, 00:00

Re: Problem in Country Dropdown

Post by aimeos » 03 Nov 2021, 07:58

In 2020.10 and later, the problem has been fixed by using a local list of countries instead of asking a REST API for that information.
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

createanet
Posts: 72
Joined: 22 Mar 2021, 16:56

Re: Problem in Country Dropdown

Post by createanet » 01 Dec 2021, 06:36

Do you mean 2020.10 and later? Only I cant see the changes that reflect this.

https://github.com/aimeos/ai-admin-jqad ... #L132-L168

User avatar
aimeos
Administrator
Posts: 7866
Joined: 01 Jan 1970, 00:00

Re: Problem in Country Dropdown

Post by aimeos » 01 Dec 2021, 12:45

The JS method is still there for backward compatibility but the country drop-downs are now populated from confiugration:
https://github.com/aimeos/ai-admin-jqad ... #L335-L348

Keep in mind that you need to adapt your own templates if you've overwritten the Aimeos ones.
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

createanet
Posts: 72
Joined: 22 Mar 2021, 16:56

Re: Problem in Country Dropdown

Post by createanet » 02 Dec 2021, 15:06

I should have checked the template, thank you :)

Post Reply