mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2025-07-15 12:54:30 +02:00
Fixed exception when creating a new part.
This commit is contained in:
parent
fe7ce39042
commit
6e68ff5b44
1 changed files with 4 additions and 0 deletions
|
@ -223,6 +223,10 @@ class PartBaseType extends AbstractType
|
|||
},
|
||||
'choice_label' => 'name',
|
||||
'query_builder' => function (EntityRepository $er) use ($part) {
|
||||
if ($part->getID() == null) {
|
||||
//This query is always false, so we get empty results
|
||||
return $er->createQueryBuilder('u')->where('0 = 2');
|
||||
}
|
||||
return $er->createQueryBuilder('u')
|
||||
->where('u.element = ?1')
|
||||
->andWhere("u.path <> ''")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue