API: allow to set user for timesheet (#1259)

This commit is contained in:
Kevin Papst
2019-11-23 14:21:46 +01:00
committed by GitHub
parent 04dd6b900f
commit 641c199c8c
3 changed files with 8 additions and 2 deletions

View File

@@ -225,7 +225,7 @@ class TimesheetEditForm extends AbstractType
'group_by' => null,
'query_builder' => function (ProjectRepository $repo) use ($builder, $project, $customer, $isNew) {
// is there a better wa to prevent starting a record with a hidden project ?
if ($isNew && !is_object($project)) {
if ($isNew && !empty($project) && (is_int($project) || is_string($project))) {
/** @var Project $project */
$project = $repo->find($project);
if (null !== $project) {