mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2026-03-05 15:05:58 +01:00
Fixed exception when creating a new part.
This commit is contained in:
@@ -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 <> ''")
|
||||
|
||||
Reference in New Issue
Block a user