Skip to content
Snippets Groups Projects
Commit 3cb36cee authored by Antony Le Courtes's avatar Antony Le Courtes
Browse files

Ajout d'un try catch préventif pour éviter une exception sur la saisie de...

Ajout d'un try catch préventif pour éviter une exception sur la saisie de service référentiel dans le cas où une fonction référentiel est accrochée à une structure historisée. (#38250)
parent 27c0d114
Branches php82
Tags 6.1.0
No related merge requests found
......@@ -3,6 +3,7 @@
namespace Application\Entity\Db;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\ORM\EntityNotFoundException;
use UnicaenApp\Entity\HistoriqueAwareInterface;
use UnicaenApp\Entity\HistoriqueAwareTrait;
......@@ -385,10 +386,14 @@ class FonctionReferentiel implements HistoriqueAwareInterface
public function __toString()
{
$str = $this->getLibelleCourt();
//Try catch préventif dans le cas d'une fonction référentiel attachée à une structure historisée.
try {
if ($this->getStructure()) {
$str .= " (" . $this->getStructure() . ")";
}
} catch (EntityNotFoundException $e) {
return $str;
}
return $str;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment