diff --git a/lib/Service/AttachmentService.php b/lib/Service/AttachmentService.php index c0471cc92..36ce4b7bc 100644 --- a/lib/Service/AttachmentService.php +++ b/lib/Service/AttachmentService.php @@ -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; }