mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2026-03-16 02:47:45 +00:00
Reorder write and flush operations in AuditEventDumper::dump for consistent stored object persistence.
- Moved `storedObjectManager->write` call before `entityManager->flush` to ensure data integrity.
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user