diff --git a/CHANGELOG.md b/CHANGELOG.md index 81b7905..c677439 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -43,6 +43,10 @@ fichero regular en lugar de symlink - `systemd-journal-remote` y `logrotate` añadidos como dependencias del paquete +## [1.7.12] - 2026-05-14 +### Fixed +- Corregida migracion de perfiles hardware y software, los tipos de software y hardware no se guardaban en base de datos antes de tener que ser usados por los perfiles. + ## [1.7.11] - 2026-05-14 ### Fixed - Corregido error "Call to undefined method App\Entity\Image::setRemotePc()" al importar una imagen desde un repositorio. La propiedad `remotePc` fue eliminada de la entidad `Image` en la versión 1.7.0 pero la llamada a `setRemotePc()` no fue eliminada del controlador `ImportAction`. diff --git a/src/Command/Migration/MigrateHardwareAndHardwareProfileCommand.php b/src/Command/Migration/MigrateHardwareAndHardwareProfileCommand.php index 05e0d45..1ca7254 100644 --- a/src/Command/Migration/MigrateHardwareAndHardwareProfileCommand.php +++ b/src/Command/Migration/MigrateHardwareAndHardwareProfileCommand.php @@ -59,6 +59,7 @@ class MigrateHardwareAndHardwareProfileCommand extends Command $this->entityManager->persist($hardwareProfileEntity); } + $this->entityManager->flush(); /** Obtener los hardware de la base de datos antigua **/ $rsmHardware = new ResultSetMapping(); @@ -97,6 +98,7 @@ class MigrateHardwareAndHardwareProfileCommand extends Command $this->entityManager->persist($hardwareEntity); } + $this->entityManager->flush(); /** * In OpenGnsys 2.0, HardwareProfile is linked OneToOne with Client and is mandatory. diff --git a/src/Command/Migration/MigrateSoftwareAndSoftwareProfileCommand.php b/src/Command/Migration/MigrateSoftwareAndSoftwareProfileCommand.php index a3ce7e7..35af7a9 100644 --- a/src/Command/Migration/MigrateSoftwareAndSoftwareProfileCommand.php +++ b/src/Command/Migration/MigrateSoftwareAndSoftwareProfileCommand.php @@ -73,6 +73,7 @@ class MigrateSoftwareAndSoftwareProfileCommand extends Command $this->entityManager->persist($softwareEntity); } + $this->entityManager->flush(); /** Obtener los perfiles software de la base de datos antigua **/ $rsmSoftwareProfiles = new ResultSetMapping(); @@ -104,6 +105,7 @@ class MigrateSoftwareAndSoftwareProfileCommand extends Command $this->entityManager->persist($softwareProfileEntity); } + $this->entityManager->flush(); /** Obtener los software, y asignarselos a los perfiles software **/ $rsmSoftwareProfilesRelation = new ResultSetMapping(); diff --git a/src/Dto/Output/HardwareOutput.php b/src/Dto/Output/HardwareOutput.php index 39a1d80..4763286 100644 --- a/src/Dto/Output/HardwareOutput.php +++ b/src/Dto/Output/HardwareOutput.php @@ -51,7 +51,7 @@ final class HardwareOutput extends AbstractOutput $this->name = $hardware->getName(); $this->description = $hardware->getDescription(); - $this->type = new HardwareTypeOutput($hardware->getType()); + $this->type = $hardware->getType() ? new HardwareTypeOutput($hardware->getType()) : null; $this->createdAt = $hardware->getCreatedAt(); $this->createdBy = $hardware->getCreatedBy(); }