diff --git a/src/Controller/PublicController.php b/src/Controller/PublicController.php index 2365c497..d2a771b3 100644 --- a/src/Controller/PublicController.php +++ b/src/Controller/PublicController.php @@ -247,19 +247,14 @@ class PublicController extends AbstractController if (strpos($key, 'commerce_tag_value__') === 0) { $tagKey = str_replace('commerce_tag_value__', '', $key); if (!empty($value)) { - // Validation des données selon le type de tag - if ($tagKey === 'addr:postcode') { - // Vérifier que c'est bien un code postal français (5 chiffres) - if (!preg_match('/^\d{5}$/', $value)) { - $status = "Erreur : Le code postal doit être composé de 5 chiffres"; - continue; - } - } + $tags[$tagKey] = trim($value); } } } + var_dump($tags); + // Récupérer le token OSM depuis les variables d'environnement $osm_api_token = $_ENV['APP_OSM_BEARER']; @@ -355,6 +350,15 @@ class PublicController extends AbstractController // Debug de la réponse en cas d'erreur if (method_exists($e, 'getResponse')) { var_dump($e->getResponse()->getBody()->getContents()); + // Faire un log d'action lors d'une erreur de soumission + $this->actionLogger->log('ERROR_submit_object_exception', [ + 'osm_id' => $osm_object_id ?? null, + 'version' => $version ?? null, + 'changesetID' => $changesetID ?? null, + 'body_sent' => $xmlString ?? null, + 'exception_message' => $e->getMessage(), + 'trace' => $e->getTraceAsString(), + ]); } } } @@ -373,7 +377,7 @@ class PublicController extends AbstractController } if (!$stats) { $stats = new Stats(); - $stats->setZipCode($place->getZipCode()); + $stats->setZone($place->getZipCode()); } $stats->addPlace($place); @@ -386,6 +390,7 @@ class PublicController extends AbstractController $this->entityManager->flush(); $this->entityManager->clear(); + return $this->render('public/view.html.twig', [ 'controller_name' => 'PublicController', 'commerce' => $commerce_overpass, @@ -397,6 +402,7 @@ class PublicController extends AbstractController 'mapbox_token' => $_ENV['MAPBOX_TOKEN'], 'maptiler_token' => $_ENV['MAPTILER_TOKEN'], 'hide_filled_inputs' => false, + 'excluded_tags_to_render' => $this->motocultrice->excluded_tags_to_render, ]); } diff --git a/templates/public/edit.html.twig b/templates/public/edit.html.twig index b5bd52d4..c6523047 100644 --- a/templates/public/edit.html.twig +++ b/templates/public/edit.html.twig @@ -87,7 +87,9 @@ placeholder="+33 1 23 45 67 89">
diff --git a/templates/public/edit/tags.html.twig b/templates/public/edit/tags.html.twig index 298a6c0f..d134f6f0 100644 --- a/templates/public/edit/tags.html.twig +++ b/templates/public/edit/tags.html.twig @@ -1,6 +1,7 @@ {% block tags %} {% endblock %} \ No newline at end of file diff --git a/templates/public/edit/yenaunpeuplusjevouslemets.html.twig b/templates/public/edit/yenaunpeuplusjevouslemets.html.twig index 1678c32a..3130bee7 100644 --- a/templates/public/edit/yenaunpeuplusjevouslemets.html.twig +++ b/templates/public/edit/yenaunpeuplusjevouslemets.html.twig @@ -79,7 +79,11 @@ moyens de paiement proposés téléphone