fix broken sql in activity admin (#506)
* fix broken sql in activity admin * pre-select customer for existing activities
This commit is contained in:
@@ -59,6 +59,7 @@ class ActivityEditForm extends AbstractType
|
||||
'query_builder' => function (CustomerRepository $repo) use ($customer) {
|
||||
return $repo->builderForEntityType($customer);
|
||||
},
|
||||
'data' => $customer ? $customer : null,
|
||||
'required' => false,
|
||||
'mapped' => false,
|
||||
'attr' => [
|
||||
|
||||
@@ -206,7 +206,9 @@ class ActivityRepository extends AbstractRepository
|
||||
$qb->orderBy('a.project', 'ASC');
|
||||
}
|
||||
|
||||
$qb->andWhere($or);
|
||||
if ($or->count() > 0) {
|
||||
$qb->andWhere($or);
|
||||
}
|
||||
|
||||
return $this->getBaseQueryResult($qb, $query);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user