refs #2540. Fixed bug when delete client
ogcore-debian-package/pipeline/head This commit looks good Details
testing/ogcore-api/pipeline/head This commit looks good Details

main
Manuel Aranda Rosales 2025-07-29 12:22:34 +02:00
parent 177b95f1b6
commit 82d5edb55b
3 changed files with 14 additions and 4 deletions

View File

@ -1,4 +1,14 @@
# Changelog
## [0.17.1] - 2025-07-29
### Fixed
- Se ha corregido un bug que aparecia al borrar un cliente. Este error hacia que se borrara el cliente de la base de datos, pero no del DHCP ( en caso de que perteneciera a uno) y el fichero de arranque.
---
## [0.17.0] - 2025-07-20
### Added
- Se ha añadido la funcionalidad para modificar imagenes de ogGit.
---
## [0.16.0] - 2025-06-27
### Added
- Se ha cambiado el html del menu para ser compatible con HTML5.

View File

@ -29,7 +29,7 @@ class DeleteHostAction extends AbstractOgDhcpController
{
$client = $this->entityManager->getRepository(Client::class)->findOneBy(['uuid' => $clientUuid]);
if (!$client || $client->getSubnet() !== $data) {
if (!$client) {
throw new BadRequestHttpException('Client not found');
}

View File

@ -103,16 +103,16 @@ readonly class ClientProcessor implements ProcessorInterface
private function processDelete($data, Operation $operation, array $uriVariables = [], array $context = []): null
{
$client = $this->clientRepository->findOneByUuid($uriVariables['uuid']);
$this->clientRepository->delete($client);
if ($this->kernel->getEnvironment() !== 'test') {
if ($client->getSubnet()) {
$this->deleteHostAction->__invoke($client->getSubnet(), $client->getUuid());
}
$this->deletePxeAction->__invoke($client->getUuid());
$this->deletePxeAction->__invoke($client->getMac());
}
$this->clientRepository->delete($client);
return null;
}
}