Commit c30b03ac authored by Bertrand Gauthier's avatar Bertrand Gauthier
Browse files

[FIX] Vilain plantage des aides de vues de navigation lorsque la route demandée n'existe pas.

parent d45b1ee1
Loading
Loading
Loading
Loading
+2 −0
Changes for CHANGELOG.md: 2 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -5,9 +5,11 @@ Journal des modifications
-----
- Ajout de la possibilité de modifier une proposition de soutenance pour gestion (sans retrait de validation)
- Ajout d'un filtrage des soutenances par états
- [FIX] Vilain plantage des aides de vues de navigation lorsque la route demandée n'existe pas.  
- [FIX] Ligne de commande de lancement de toutes les synchros.
- [FIX] Correction du texte de la convocation s'attendant à avoir un individu (pas toujours le cas car le lien n'est pas fait systèmatiquement).
- [FIX] La recherche du doctorant lié à un individu doit écarter les individus historisés.

2.2.0
-----
MISSING
+7 −0
Changes for module/Application/src/Application/Navigation/ApplicationNavigationFactory.php: 7 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -60,15 +60,22 @@ class ApplicationNavigationFactory extends NavigationFactory
    protected function handleParamsInjection(array &$page, RouteMatch $routeMatch = null)
    {
        parent::handleParamsInjection($page, $routeMatch);
        if (($page['visible'] ?? true) === false) {
            return $this;
        }

        /** @var \Application\RouteMatch $routeMatch */

        if (in_array('these', (array)$page['paramsInject'])) {
            if ($routeMatch === null) {
                $page['visible'] = false;
            } else {
                $these = $routeMatch->getThese();
                if ($these !== null) {
                    $this->injectThese($page, $these);
                }
            }
        }

        return $this;
    }
+4 −5
Changes for module/Application/src/Application/Navigation/NavigationFactory.php: 4 added lines, 5 removed lines.
Original line number Diff line number Diff line
@@ -86,7 +86,7 @@ class NavigationFactory extends DefaultNavigationFactory
        }

        // injections éventuelles de paramètres de page à partir du RouteMatch
        if ($this->canHandleParamsInjection($page, $routeMatch)) {
        if ($this->canHandleParamsInjection($page)) {
            $this->handleParamsInjection($page, $routeMatch);
        }
    }
@@ -170,12 +170,11 @@ class NavigationFactory extends DefaultNavigationFactory

    /**
     * @param array $page
     * @param RouteMatch|null $routeMatch
     * @return bool
     */
    protected function canHandleParamsInjection(array $page, RouteMatch $routeMatch = null)
    protected function canHandleParamsInjection(array $page)
    {
        return $routeMatch && isset($page['withtarget']) && isset($page['paramsInject']);
        return isset($page['withtarget']) && isset($page['paramsInject']);
    }

    /**
@@ -200,7 +199,7 @@ class NavigationFactory extends DefaultNavigationFactory
    protected function handleParamsInjection(array &$page, RouteMatch $routeMatch = null)
    {
        foreach ((array) $page['paramsInject'] as $param) {
            if (($id = $routeMatch->getParam($param))) {
            if ($routeMatch && ($id = $routeMatch->getParam($param))) {
                $page['params'][$param] = $id;
            }
            else {