Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix wrong deletions #3630

Merged
merged 9 commits into from
Jun 17, 2024
Merged

Fix wrong deletions #3630

merged 9 commits into from
Jun 17, 2024

Conversation

inalto
Copy link
Contributor

@inalto inalto commented Jun 7, 2024

In case of custom paths setup to save the images in the same subdirectory ex. username/post_id/photos/somefile.ext when a file is removed from the media directory it wipes all the directory content.

This commit fixes this problem only deleting the proper images (and related conversions and responsive images) and delete the directory only if is empty.

@freekmurze
Copy link
Member

Hi, could you also add a test to prove that this works?

@inalto
Copy link
Contributor Author

inalto commented Jun 10, 2024

yes, I write one

@inalto
Copy link
Contributor Author

inalto commented Jun 13, 2024

hello, i added some test and spotted some bugs on DefaultFileRemover, now i look at failing tests

@inalto
Copy link
Contributor Author

inalto commented Jun 13, 2024

Problem in case of custom-named media is fixed now. And all the test are passing, included new ones.

@freekmurze freekmurze merged commit cafaa5f into spatie:main Jun 17, 2024
9 checks passed
@freekmurze
Copy link
Member

Thank you very much!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants