Skip to content

Commit 803b3cf

Browse files
agiulianoweaverryan
authored andcommitted
Fix upload code
1 parent 2de64b0 commit 803b3cf

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

cookbook/doctrine/file_uploads.rst

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -407,7 +407,7 @@ Next, refactor the ``Document`` class to take advantage of these callbacks::
407407
// the entity from being persisted to the database on error
408408
$this->getFile()->move($this->getUploadRootDir(), $this->path);
409409

410-
$this->setFile(null);
410+
411411

412412
// check if we have an old image
413413
if (isset($this->temp)) {
@@ -416,6 +416,7 @@ Next, refactor the ``Document`` class to take advantage of these callbacks::
416416
// clear the temp image path
417417
$this->temp = null;
418418
}
419+
$this->setFile(null);
419420
}
420421

421422
/**

0 commit comments

Comments
 (0)