Fixed the file deleting mechanism when changing/deleting attachments.

Also the file is also delted from thumbnail cache.
This commit is contained in:
Jan Böhmer 2019-10-19 19:53:37 +02:00
parent d859d8533d
commit 650ad4b578
2 changed files with 16 additions and 3 deletions

View file

@ -90,7 +90,7 @@ class AttachmentDeleteListener
public function postRemoveHandler(Attachment $attachment, LifecycleEventArgs $event)
{
//Dont delete file if the attachment uses a builtin ressource:
if (Attachment::checkIfBuiltin($event->getOldValue('path'))) {
if ($attachment->isBuiltIn()) {
return;
}