Skip to content

Commit 713f382

Browse files
matt9mgxabbuh
authored andcommitted
Doctrine event listener could persist a null value
In the current docs if say the product name is updated it looks like the fileName would be null meaning if a product alread has a brichure it would be removed?
1 parent 551efc0 commit 713f382

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)