Fix counting attachments

Signed-off-by: Julius Härtl <jus@bitgrid.net>
This commit is contained in:
Julius Härtl
2020-12-29 16:36:16 +01:00
parent 65e19f9ea4
commit e095302750

View File

@@ -152,11 +152,17 @@ class AttachmentService {
$count = $this->cache->get('card-' . $cardId);
if (!$count) {
$count = count($this->attachmentMapper->findAll($cardId));
foreach (array_keys($this->services) as $attachmentType) {
$service = $this->getService($attachmentType);
if ($service instanceof ICustomAttachmentService) {
$count += $service->getAttachmentCount($cardId);
}
}
$this->cache->set('card-' . $cardId, $count);
}
return $count;
}