From 464acdf9f3f3bc41d8e41551498768ecbc54650f Mon Sep 17 00:00:00 2001 From: Pascal Garneau Date: Mon, 6 May 2024 15:24:11 -0400 Subject: [PATCH 1/6] Add french translation Only what the end user will see --- src/translations/fr/simplemap.php | 38 +++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 src/translations/fr/simplemap.php diff --git a/src/translations/fr/simplemap.php b/src/translations/fr/simplemap.php new file mode 100644 index 0000000..bc19146 --- /dev/null +++ b/src/translations/fr/simplemap.php @@ -0,0 +1,38 @@ + 'Carte', + 'Geo-Coding' => 'Géocodage', + + 'Search for a location' => 'Rechercher un lieu', + 'Clear address' => 'Effacer l\'adresse', + 'No address selected' => 'Aucune adresse sélectionnée', + + 'Full Address' => 'Adresse complète', + 'Name / Number' => 'Nom / numéro', + 'Street Address' => 'Adresse de rue', + 'Town / City' => 'Ville', + 'Postcode' => 'Code postal', + 'County' => 'Comté', + 'State' => 'État / province', + 'Country' => 'Pays', + + 'Latitude' => 'Latitude', + 'Longitude' => 'Longitude', + + 'Zoom In' => 'Zoomer', + 'Zoom Out' => 'Dézoomer', + 'Center on Marker' => 'Centrer sur le marqueur', + 'Current Location' => 'Localisation actuelle', + +]; \ No newline at end of file From 07594b09d4bb5a889949188999add14c393de796 Mon Sep 17 00:00:00 2001 From: Tam Date: Wed, 8 May 2024 15:22:54 +0100 Subject: [PATCH 2/6] Update CHANGELOG.md --- CHANGELOG.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 68dc101..69b3ba2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,7 @@ +## 4.0.6 - 2024-05-08 +### Added +- French translations (via @pascalminator) + ## 4.0.5 - 2024-04-04 ### Fixed - Fix referred on Mapbox geo requests (Fixes #338, via @maxdmyers) From c51add1b905427111680a7066bf68a37d1233e47 Mon Sep 17 00:00:00 2001 From: Tam Date: Thu, 6 Jun 2024 11:10:22 +0100 Subject: [PATCH 3/6] Fix issue when using count query on location search results Fixes #391 --- CHANGELOG.md | 4 ++++ src/services/MapService.php | 17 +++++++++++------ 2 files changed, 15 insertions(+), 6 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 69b3ba2..fa3b9a9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,7 @@ +## 4.0.7 - 2024-06-06 +### Fixed +- Fix issue when using count query on location search results (Fixes #391) + ## 4.0.6 - 2024-05-08 ### Added - French translations (via @pascalminator) diff --git a/src/services/MapService.php b/src/services/MapService.php index baf7a29..38466dd 100644 --- a/src/services/MapService.php +++ b/src/services/MapService.php @@ -373,19 +373,24 @@ private function _searchLocation (ElementQuery $query, mixed $value, string $tab ]; // Filter the query - $query - ->subQuery - ->addSelect($search . ' as [[mapsCalculatedDistance]]') + $subQuery = $query->subQuery; + $isCount = count($query->select) == 1 && array_values($query->select)[0] == 'COUNT(*)'; + + if (!$isCount) + $subQuery + ->addSelect($search . ' as [[mapsCalculatedDistance]]'); + + $subQuery ->andWhere($restrict) ->andWhere([ 'not', ['[[' . $table . '.lat]]' => null], ]); - if (Craft::$app->getDb()->driverName === 'pgsql') - $query->subQuery->andWhere($search . ' <= ' . $radius); + if (Craft::$app->getDb()->driverName === 'pgsql' || $isCount) + $subQuery->andWhere($search . ' <= ' . $radius); else - $query->subQuery->andHaving('[[mapsCalculatedDistance]] <= ' . $radius); + $subQuery->andHaving('[[mapsCalculatedDistance]] <= ' . $radius); return '[[mapsCalculatedDistance]]'; } From 95f6a35747869b98630588ed74cfd4d56734491a Mon Sep 17 00:00:00 2001 From: Tam Date: Thu, 27 Jun 2024 11:15:16 +0100 Subject: [PATCH 4/6] Remove Polyfill.io --- src/fields/MapField.php | 1 - 1 file changed, 1 deletion(-) diff --git a/src/fields/MapField.php b/src/fields/MapField.php index 009bcfb..0461728 100644 --- a/src/fields/MapField.php +++ b/src/fields/MapField.php @@ -474,7 +474,6 @@ private function _renderMap (Map $value, bool $isSettings = false): string $containerId = 'map-' . $this->id . '-container'; $vueContainerId = $view->namespaceInputId($containerId); - $view->registerJsFile('https://polyfill.io/v3/polyfill.min.js?flags=gated&features=default%2CIntersectionObserver%2CIntersectionObserverEntry'); $view->registerAssetBundle(MapAsset::class); $view->registerJs('new Vue({ el: \'#' . $vueContainerId . '\' });'); $view->registerTranslations('simplemap', [ From 87efd6cc25f16f18b4615ef187a410d50f5a46f6 Mon Sep 17 00:00:00 2001 From: Tam Date: Thu, 27 Jun 2024 11:19:33 +0100 Subject: [PATCH 5/6] Update CHANGELOG.md --- CHANGELOG.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index fa3b9a9..d791309 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,7 @@ +## 4.0.8 - 2024-06-27 +### Security +- Removed Polyfill.io (https://sansec.io/research/polyfill-supply-chain-attack) + ## 4.0.7 - 2024-06-06 ### Fixed - Fix issue when using count query on location search results (Fixes #391) From ff88b5565a217d92510fc7260b846b689aa6ff63 Mon Sep 17 00:00:00 2001 From: Tam Date: Thu, 27 Jun 2024 11:34:02 +0100 Subject: [PATCH 6/6] Update CHANGELOG.md --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d791309..48514b6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,4 @@ -## 4.0.8 - 2024-06-27 +## 4.0.8 - 2024-06-27 [CRITICAL] ### Security - Removed Polyfill.io (https://sansec.io/research/polyfill-supply-chain-attack)