fix find activity for project (#3681)

This commit is contained in:
Kevin Papst
2022-12-07 22:42:02 +01:00
committed by GitHub
parent db0e555eae
commit b8b3a3c8ab
2 changed files with 2 additions and 2 deletions

View File

@@ -104,6 +104,6 @@ class ActivityService
public function findActivityByName(string $name, ?Project $project = null): ?Activity
{
return $this->repository->findOneBy(['project' => $project, 'name' => $name]);
return $this->repository->findOneBy(['project' => $project->getId(), 'name' => $name]);
}
}

View File

@@ -508,7 +508,7 @@ class ImportTimesheetCommand extends Command
{
$tmpActivity = null;
$tmpActivities = $this->activities->findBy(['project' => $project, 'name' => $activity]);
$tmpActivities = $this->activities->findBy(['project' => $project->getId(), 'name' => $activity]);
if (\count($tmpActivities) === 0) {
$tmpActivity = $this->activities->findOneBy(['project' => null, 'name' => $activity]);