From f9d36cc8a9bf5955d97217bf39aa95bf6fc1688a Mon Sep 17 00:00:00 2001 From: Pol Dellaiera Date: Thu, 18 Nov 2021 12:03:49 +0100 Subject: [PATCH] fix: Fix bug reported by the tests. --- .../ChillActivityBundle/Timeline/TimelineActivityProvider.php | 3 +-- src/Bundle/ChillPersonBundle/Entity/Person.php | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/src/Bundle/ChillActivityBundle/Timeline/TimelineActivityProvider.php b/src/Bundle/ChillActivityBundle/Timeline/TimelineActivityProvider.php index fb0a5c45c..041978421 100644 --- a/src/Bundle/ChillActivityBundle/Timeline/TimelineActivityProvider.php +++ b/src/Bundle/ChillActivityBundle/Timeline/TimelineActivityProvider.php @@ -79,8 +79,7 @@ class TimelineActivityProvider implements TimelineProviderInterface $metadataActivity = $this->em->getClassMetadata(Activity::class); $associationMapping = $metadataActivity->getAssociationMapping('person'); $role = new Role('CHILL_ACTIVITY_SEE'); - $reachableScopes = $this->helper->getReachableScopes($this->user, - $role, $person->getCenter()); + $reachableScopes = $this->helper->getReachableScopes($this->user, $role->getRole(), $person->getCenter()); $whereClause = sprintf(' {activity.person_id} = ? AND {activity.scope_id} IN ({scopes_ids}) '); $scopes_ids = []; diff --git a/src/Bundle/ChillPersonBundle/Entity/Person.php b/src/Bundle/ChillPersonBundle/Entity/Person.php index df2f8ac51..1c2842b6a 100644 --- a/src/Bundle/ChillPersonBundle/Entity/Person.php +++ b/src/Bundle/ChillPersonBundle/Entity/Person.php @@ -63,7 +63,7 @@ class Person implements HasCenterInterface, TrackCreationInterface, TrackUpdateI * @ORM\Column(name="id", type="integer") * @ORM\GeneratedValue(strategy="AUTO") */ - private int $id; + private ?int $id = null; /** * The person's first name