diff --git a/Classes/Domain/Repository/FileReferenceRepository.php b/Classes/Domain/Repository/FileReferenceRepository.php index 893f8cf..32233cf 100644 --- a/Classes/Domain/Repository/FileReferenceRepository.php +++ b/Classes/Domain/Repository/FileReferenceRepository.php @@ -50,8 +50,8 @@ public function getReferencesOnPage(int $pageId): array $event = new AfterImageReferencesLoadedEvent($result->toArray()); $this->eventDispatcher->dispatch($event); - $result = array_filter( - ArrayUtility::uniqueObjectsByProperty($event->getFileReferences(), 'uidLocal'), + $result = ArrayUtility::uniqueObjectsByProperty(array_filter( + $event->getFileReferences(), function (FileReference $reference) { $qb = $this->connectionPool->getQueryBuilderForTable($reference->getTablenames()); $query = $qb->from($reference->getTablenames()) @@ -66,7 +66,7 @@ function (FileReference $reference) { $rowCount = $query->executeQuery()->rowCount(); return $rowCount > 0; } - ); + ), 'uidLocal'); $event = new AfterImageReferencesDeduplicatedEvent($result); $this->eventDispatcher->dispatch($event);