Commit 098e16c9 authored by Bertrand Gauthier's avatar Bertrand Gauthier
Browse files

[FIX] Plantage de RapportActiviteAssertion lorsque la route demandée n'existe pas.

parent ca20eeee
Loading
Loading
Loading
Loading
+1 −0
Changes for CHANGELOG.md: 1 added line, 0 removed lines.
Original line number Diff line number Diff line
@@ -7,6 +7,7 @@ Journal des modifications
- Changement du terme Établissement par Site dans l'affichage des rôles des EDs et des URs pour éviter la confusion
- [FIX] retrait d'un début faisant planter la génération de convaocation de soutenance 
- [FIX] Correction du plantage lors de la création manuelle d'un utilisateur.
- [FIX] Plantage de RapportActiviteAssertion lorsque la route demandée n'existe pas.

4.2.0
-----
+5 −3
Changes for module/RapportActivite/src/RapportActivite/Assertion/RapportActiviteAssertion.php: 5 added lines, 3 removed lines.
Original line number Diff line number Diff line
@@ -191,15 +191,17 @@ class RapportActiviteAssertion extends AbstractAssertion
    {
        if ($rapportActivite = $this->getRequestedRapport()) {
            return $rapportActivite->getThese();
        } elseif ($routeMatch = $this->getRouteMatch()) {
            return $routeMatch->getThese();
        } else {
            return $this->getRouteMatch()->getThese();
            return null;
        }
    }

    private function getRequestedRapport(): ?RapportActivite
    {
        $rapportActivite = null;
        if ($id = $this->getRouteMatch()->getParam('rapport')) {
        if (($routeMatch = $this->getRouteMatch()) && $id = $routeMatch->getParam('rapport')) {
            $rapportActivite = $this->rapportActiviteService->findRapportById($id);
        }

@@ -258,7 +260,7 @@ class RapportActiviteAssertion extends AbstractAssertion
    }


    protected function getRouteMatch(): RouteMatch
    protected function getRouteMatch(): ?RouteMatch
    {
        /** @var \Application\RouteMatch $rm */
        return $this->getMvcEvent()->getRouteMatch();