From cd104f10acf26d2bc04ff8189e2fd12d755cc61a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julien=20Fastr=C3=A9?= Date: Thu, 5 Mar 2026 13:50:03 +0100 Subject: [PATCH] Reorder `write` and `flush` operations in `AuditEventDumper::dump` for consistent stored object persistence. - Moved `storedObjectManager->write` call before `entityManager->flush` to ensure data integrity. --- src/Bundle/ChillMainBundle/Audit/AuditEventDumper.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Bundle/ChillMainBundle/Audit/AuditEventDumper.php b/src/Bundle/ChillMainBundle/Audit/AuditEventDumper.php index d7334118a..243dde001 100644 --- a/src/Bundle/ChillMainBundle/Audit/AuditEventDumper.php +++ b/src/Bundle/ChillMainBundle/Audit/AuditEventDumper.php @@ -134,13 +134,13 @@ class AuditEventDumper fclose($handle); + $content = file_get_contents($tmpPath); + $this->storedObjectManager->write($storedObject, $content, 'text/csv'); + // Persist stored object so that a valid identifier exists in DB $storedObject->setStatus(StoredObject::STATUS_READY); $this->entityManager->flush(); - $content = file_get_contents($tmpPath); - $this->storedObjectManager->write($storedObject, $content, 'text/csv'); - // Remove temp file from disk @unlink($tmpPath); }