diff --git a/composer.json b/composer.json index c48f1a2..21cbc3b 100644 --- a/composer.json +++ b/composer.json @@ -21,9 +21,10 @@ "pimcore/newsletter-bundle": "^1.0", "colinmollenhour/credis": "^1.10.0", "mjaschen/phpgeo": "^4.0", - "pimcore/admin-ui-classic-bundle": "^1.0" + "pimcore/admin-ui-classic-bundle": "^1.0.6" }, "require-dev": { + "phpunit/phpunit": "^9.5", "phpstan/phpstan": "^1.10.5", "phpstan/phpstan-symfony": "^1.2.14", "codeception/phpunit-wrapper": "^9", diff --git a/public/js/settings/conditions.js b/public/js/settings/conditions.js index f6abb27..90c7684 100644 --- a/public/js/settings/conditions.js +++ b/public/js/settings/conditions.js @@ -258,18 +258,18 @@ pimcore.bundle.personalization.settings.conditions = (function () { var leafletMap, marker, circle; var searchHandler = function() { - var address = searchfield.getValue(); - Ext.Ajax.request({ - url: pimcore.bundle.personalization.settings.conditions.getSearchUrl(address), - method: "GET", - success: function (response, opts) { - var data = Ext.decode(response.responseText); + const address = searchfield.getValue(); + pimcore.helpers.sendRequest( + "GET", + pimcore.bundle.personalization.settings.conditions.getSearchUrl(address), + function (response) { + const data = Ext.decode(response.responseText); if (data[0].lat !== null && data[0].lon !== null) { marker.setLatLng(L.latLng(data[0].lat, data[0].lon)); leafletMap.setView(L.latLng(data[0].lat, data[0].lon), 7); } - }.bind(this), - }); + } + ); }; var searchfield = new Ext.form.TextField({ @@ -740,8 +740,7 @@ pimcore.bundle.personalization.settings.conditions = (function () { }, getSearchUrl: function (query) { - var url = pimcore.settings.geocoding_url_template.replace('{q}', urlencode(query)); - return url; + return pimcore.settings.geocoding_url_template.replace('{q}', urlencode(query)); }, get: function (name) {