diff --git a/src/Activity/ActivityService.php b/src/Activity/ActivityService.php index cfcf2bde..d4ff5cd8 100644 --- a/src/Activity/ActivityService.php +++ b/src/Activity/ActivityService.php @@ -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]); } } diff --git a/src/Command/ImportTimesheetCommand.php b/src/Command/ImportTimesheetCommand.php index 63394219..7dc4d131 100644 --- a/src/Command/ImportTimesheetCommand.php +++ b/src/Command/ImportTimesheetCommand.php @@ -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]);