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

(Why is) The cached transform not cleared @ EVENT_AFTER_DELETE_ELEMENT #291

Open
ghost opened this issue Jan 6, 2020 · 2 comments
Open

Comments

@ghost
Copy link

ghost commented Jan 6, 2020

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 when Assets::EVENT_AFTER_REPLACE_ASSET fires.

@aelvan
Copy link
Owner

aelvan commented Jan 6, 2020

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?

@ghost
Copy link
Author

ghost commented Jan 6, 2020

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.

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

No branches or pull requests

1 participant