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); }