EasyCorp / EasyCorp/EasyAdminBundle
ImageField: image not deleted
Nobody has claimed this yet.
- Dominant language
- PHP
- Stars
- 4.3k
- Forks
- 1.1k
- Avg merge
- 8d 2h
- Merged PRs (30d)
- 11
Description
When an image is deleted (ImageField), the database entry is set to an empty string and the file remains. What does work, however, is replacing an image; in that case, the previous file is deleted.
In FileUploadState $deletedFiles is correctly set, but $delete is false, that seems to be the reason why the file isn't deleted in processUploadedFiles().
EasyAdmin v5.4.1
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by tracing FileUploadState and processUploadedFiles(), where $deletedFiles is set but $delete is false. Reproduce deleting an ImageField value and compare it with replacing an image. Done means the database value becomes empty and the previously uploaded file is removed.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- php, symfony
- Domain
- backend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 58/100