Skip to content

Commit a37fc7d

Browse files
committed
minor #8541 Doctrine event listener could persist a null value (matt9mg)
This PR was submitted for the 3.3 branch but it was merged into the 2.7 branch instead (closes #8541). Discussion ---------- Doctrine event listener could persist a null value In the current docs, say the entity name is updated and we have not uploaded a new file, it looks like the fileName would be null meaning if the entity already has a brochure it would be removed? Commits ------- 713f382 Doctrine event listener could persist a null value
2 parents 551efc0 + 713f382 commit a37fc7d

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

controller/upload_file.rst

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -365,9 +365,8 @@ automatically upload the file when persisting the entity::
365365
// only upload new files
366366
if ($file instanceof UploadedFile) {
367367
$fileName = $this->uploader->upload($file);
368+
$entity->setBrochure($fileName);
368369
}
369-
370-
$entity->setBrochure($fileName);
371370
}
372371
}
373372

0 commit comments

Comments
 (0)