Commit 4fe9f83d authored by Stephane Bouvry's avatar Stephane Bouvry
Browse files

Fix : Impossible de supprimer les affectations des organisations avec des "rôle inconnu"

parent 9d29f32f
Loading
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -2747,7 +2747,8 @@ class ProjectGrantService implements UseGearmanJobLauncherService, UseOscarConfi
        try {
            $activity = $activityOrganization->getActivity();
            $organization = $activityOrganization->getOrganization();
            $updateNotification = $activityOrganization->getRoleObj()->isPrincipal();
            $updateNotification = $activityOrganization->getRoleObj() &&
                $activityOrganization->getRoleObj()->isPrincipal();
            $this->getEntityManager()->remove($activityOrganization);
            $this->getEntityManager()->flush();

+1 −1
Original line number Diff line number Diff line
@@ -491,7 +491,7 @@ class ProjectService implements UseServiceContainer
    {
        $organization = $projectPartner->getOrganization();
        $project = $projectPartner->getProject();
        $update = $projectPartner->getRoleObj()->isPrincipal();
        $update = $projectPartner->getRoleObj() && $projectPartner->getRoleObj()->isPrincipal();

        $this->getLogger()->debug("Suppression du partenaire $projectPartner");