fix error when not in error for edit form

This commit is contained in:
Tykayn 2025-06-27 00:36:55 +02:00 committed by tykayn
parent b3d4064841
commit c08b49fe48

View file

@ -336,13 +336,18 @@ final class AdminController extends AbstractController
$place = $this->entityManager->getRepository(Place::class)->findOneBy(['osm_kind' => $osm_kind, 'osmId' => $osm_id]); $place = $this->entityManager->getRepository(Place::class)->findOneBy(['osm_kind' => $osm_kind, 'osmId' => $osm_id]);
if ($place) { if ($place) {
$this->actionLogger->log('ERROR_admin/placeType', ['osm_kind' => $osm_kind, 'osm_id' => $osm_id, $this->actionLogger->log('admin/placeType', ['osm_kind' => $osm_kind, 'osm_id' => $osm_id,
'name' => $place->getName(), 'name' => $place->getName(),
'code_insee' => $place->getZipCode(), 'code_insee' => $place->getZipCode(),
'uuid' => $place->getUuidForUrl() 'uuid' => $place->getUuidForUrl()
]); ]);
return $this->redirectToRoute('app_admin_commerce', ['id' => $place->getId()]); return $this->redirectToRoute('app_admin_commerce', ['id' => $place->getId()]);
} else { } else {
$this->actionLogger->log('ERROR_admin/placeType', ['osm_kind' => $osm_kind, 'osm_id' => $osm_id,
'name' => $place->getName(),
'code_insee' => $place->getZipCode(),
'uuid' => $place->getUuidForUrl()
]);
$this->addFlash('error', 'Le lieu n\'existe pas.'); $this->addFlash('error', 'Le lieu n\'existe pas.');
$this->actionLogger->log('ERROR_admin/placeType', ['osm_kind' => $osm_kind, 'osm_id' => $osm_id]); $this->actionLogger->log('ERROR_admin/placeType', ['osm_kind' => $osm_kind, 'osm_id' => $osm_id]);
return $this->redirectToRoute('app_public_index'); return $this->redirectToRoute('app_public_index');
@ -370,7 +375,7 @@ final class AdminController extends AbstractController
throw $this->createNotFoundException('Commerce non trouvé'); throw $this->createNotFoundException('Commerce non trouvé');
$this->actionLogger->log('ERROR_admin_show_commerce_form_id', ['id' => $id]); $this->actionLogger->log('ERROR_admin_show_commerce_form_id', ['id' => $id]);
} }
$this->actionLogger->log('ERROR_admin_show_commerce_form_id', [ $this->actionLogger->log('admin_show_commerce_form_id', [
'id' => $id, 'id' => $id,
'name' => $commerce->getName(), 'name' => $commerce->getName(),
'code_insee' => $commerce->getZipCode(), 'code_insee' => $commerce->getZipCode(),