mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2026-03-16 19:07:48 +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);
|
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
|
// Persist stored object so that a valid identifier exists in DB
|
||||||
$storedObject->setStatus(StoredObject::STATUS_READY);
|
$storedObject->setStatus(StoredObject::STATUS_READY);
|
||||||
$this->entityManager->flush();
|
$this->entityManager->flush();
|
||||||
|
|
||||||
$content = file_get_contents($tmpPath);
|
|
||||||
$this->storedObjectManager->write($storedObject, $content, 'text/csv');
|
|
||||||
|
|
||||||
// Remove temp file from disk
|
// Remove temp file from disk
|
||||||
@unlink($tmpPath);
|
@unlink($tmpPath);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user