-
Notifications
You must be signed in to change notification settings - Fork 69
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
(Why is) The cached transform not cleared @ EVENT_AFTER_DELETE_ELEMENT #291
Comments
The reason the transforms are cleared (from the system path/cache) when replacing assets, is because new transforms for the new image wouldn't otherwise be created, since the filename is the same. That issue is not relevant when deleting. But what I guess you allude to is that you expect Imager to deølete any transformed files if the original asset is deleted? |
That was my reasoning indeed, the original ID would never be hit when the asset is deleted, so the folder should be removed with the contents to prevent a buildup of unused images. |
It seems like it should be a logical default to hook into
Elements::EVENT_AFTER_DELETE_ELEMENT
(and check for the Asset entry type) and erase the cached image, just like what happens whenAssets::EVENT_AFTER_REPLACE_ASSET
fires.The text was updated successfully, but these errors were encountered: