Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 10 additions & 4 deletions lib/Listener/CacheEntryRemovedListener.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,16 @@ public function handle(Event $event): void {
return;
}

// Remove node from all albums containing it.
$albums = $this->albumMapper->getForFile($event->getFileId());
foreach ($albums as $album) {
$this->albumMapper->removeFile($album->getId(), $event->getFileId());
try {
// Remove node from all albums containing it.
$albums = $this->albumMapper->getForFile($event->getFileId());

foreach ($albums as $album) {
$this->albumMapper->removeFile($album->getId(), $event->getFileId());
}
} catch(\Throwable $ex) {
// If an error occur, return silently as we don't want to block the rest of the deletion process.
// It happened already during migrations when the albums table is not yet created, but a folder is deleted by the theming app.
}
}
}