-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
ImageField overwrites existing images #7525
Copy link
Copy link
Open
Milestone
Description
Describe the bug
This is explained and has a PR, but the issue was closed without merge: #5321. The issue still exists in 4.29.0
To Reproduce
- Define an ImageField, and call the required setUploadDir()
ImageField::new('image')
->setUploadDir('/public/uploads/')
->setBasePath('/uploads/')- The filename passed by StringToFileTransformer#doReverseTransform doesn't pass the full path to the file to the upload_validate callable of FileUploadType, so there will be no "_x" appended to the filename, which overwrites the existing file.
(OPTIONAL) Additional context
I've tested the PR above locally, and it resolves the issue, aside from the line numbers changing since the original PR was created.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels