From 2ac9d27d97e99cf7bb72f0dd9dc84bc9d8a665ec Mon Sep 17 00:00:00 2001 From: jmbardallo Date: Thu, 14 May 2026 14:42:16 +0200 Subject: [PATCH] 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 --- CHANGELOG.md | 4 ++++ .../Migration/MigrateHardwareAndHardwareProfileCommand.php | 2 ++ .../Migration/MigrateSoftwareAndSoftwareProfileCommand.php | 2 ++ src/Dto/Output/HardwareOutput.php | 2 +- 4 files changed, 9 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b228ddd..77f54a9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # Changelog +## [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(); }