mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2025-06-24 18:58:46 +02:00
Do not delete an file if there is an other attachment remaining after deletion.
Fixes issue #71.
This commit is contained in:
parent
a846f373c0
commit
167e46fea4
1 changed files with 3 additions and 1 deletions
|
@ -131,7 +131,9 @@ class AttachmentDeleteListener
|
|||
$file = $this->attachmentHelper->attachmentToFile($attachment);
|
||||
//Only delete if the attachment has a valid file.
|
||||
if (null !== $file) {
|
||||
$this->attachmentReverseSearch->deleteIfNotUsed($file);
|
||||
/* The original file has already been removed, so we have to decrease the threshold to zero,
|
||||
as any remaining attachment depends on this attachment, and we must not delete this file! */
|
||||
$this->attachmentReverseSearch->deleteIfNotUsed($file, 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue