Commit 72b8a9f3 authored by Jean-Philippe Metivier's avatar Jean-Philippe Metivier
Browse files

Correction problème de macro lorsque fiche de postes sans métier principale

parent 1b2f9d47
Loading
Loading
Loading
Loading
+2
Changes for module/Application/src/Application/Entity/Db/MacroContent/AgentMacroTrait.php: 2 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -300,7 +300,9 @@ trait AgentMacroTrait
        $agent = $this;
        $fiche = $agent->getFichePosteBest();

        //todo /!\ overlap avec les champs manuels du CREP
        if ($fiche === null) return "Aucune fiche de poste EMC2";
        if ($fiche->getFicheTypeExternePrincipale() === null) return "";
        $metier  = $fiche->getFicheTypeExternePrincipale()->getFicheType()->getMetier()->getReferencesAffichage();

        return $metier;