mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2026-08-03 15:11:40 +00:00
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
This commit is contained in:
parent
62f3216071
commit
c79986f758
1 changed files with 2 additions and 1 deletions
|
|
@ -235,7 +235,8 @@ class StructuralDBElementRepository extends AttachmentContainingDBElementReposit
|
|||
$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();
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue