From c79986f758dab02d94a55c070451632445f5665e Mon Sep 17 00:00:00 2001 From: buchmann Date: Tue, 28 Jul 2026 13:43:35 +0200 Subject: [PATCH] Allow alternative names with commas Simply replace the commas read from the info provider with wildcards, so they'll match any placeholder character the user chose in the alternative name definition. Fixes #1349 --- src/Repository/StructuralDBElementRepository.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Repository/StructuralDBElementRepository.php b/src/Repository/StructuralDBElementRepository.php index 7fc386718..c12e6dc67 100644 --- a/src/Repository/StructuralDBElementRepository.php +++ b/src/Repository/StructuralDBElementRepository.php @@ -235,7 +235,8 @@ public function findForInfoProvider(string $name): ?AbstractStructuralDBElement $qb = $this->createQueryBuilder('e'); //Use lowercase conversion to be case-insensitive $qb->where($qb->expr()->like('LOWER(e.alternative_names)', 'LOWER(:name)')); - $qb->setParameter('name', '%'.$name.',%'); + //Replace commas in the name with wildcard to match any placeholder character + $qb->setParameter('name', '%'.str_replace(',', '_', $name).',%'); $result = $qb->getQuery()->getResult();