From 79567824e1950aeff79c3e858a1ae6bd7c130edc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9my=20DANIEL?= Date: Thu, 15 Feb 2024 11:46:34 +0100 Subject: [PATCH] [BUGFIX] Properly handle empty taxonomy relation --- Classes/Domain/Repository/TermRepository.php | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/Classes/Domain/Repository/TermRepository.php b/Classes/Domain/Repository/TermRepository.php index ed92d0b..72ef482 100644 --- a/Classes/Domain/Repository/TermRepository.php +++ b/Classes/Domain/Repository/TermRepository.php @@ -31,6 +31,10 @@ public function findByRelation(string $tableName, string $fieldName, int $uid): $sortingForeign[$row['uid_local']] = $row['sorting_foreign']; } + if ($terms === []) { + return []; + } + // Load all the Extbase entities from the term's uid. $queryResult = $this->loadExtbaseEntities($terms); @@ -52,6 +56,10 @@ public function findOneByRelation(string $tableName, string $fieldName, int $uid $terms[] = $row['uid_local']; } + if ($terms === []) { + return null; + } + // Load all the Extbase entities from the term's uid. $queryResult = $this->loadExtbaseEntities($terms);