Fixed an exception in log page.

This commit is contained in:
Jan Böhmer 2020-02-13 23:06:39 +01:00
parent 246a96668b
commit b27079e421

View file

@ -27,6 +27,7 @@ namespace App\DataTables\Column;
use App\Entity\Base\AbstractDBElement; use App\Entity\Base\AbstractDBElement;
use App\Entity\Base\AbstractNamedDBElement; use App\Entity\Base\AbstractNamedDBElement;
use App\Entity\LogSystem\AbstractLogEntry; use App\Entity\LogSystem\AbstractLogEntry;
use App\Exceptions\EntityNotSupportedException;
use App\Services\ElementTypeNameGenerator; use App\Services\ElementTypeNameGenerator;
use App\Services\EntityURLGenerator; use App\Services\EntityURLGenerator;
use Doctrine\ORM\EntityManagerInterface; use Doctrine\ORM\EntityManagerInterface;
@ -71,11 +72,15 @@ class LogEntryTargetColumn extends AbstractColumn
//The element is existing //The element is existing
if ($target instanceof AbstractNamedDBElement) { if ($target instanceof AbstractNamedDBElement) {
return sprintf( try {
'<a href="%s">%s</a>', return sprintf(
$this->entityURLGenerator->infoURL($target), '<a href="%s">%s</a>',
$this->elementTypeNameGenerator->getTypeNameCombination($target, true) $this->entityURLGenerator->infoURL($target),
); $this->elementTypeNameGenerator->getTypeNameCombination($target, true)
);
} catch (EntityNotSupportedException $exception) {
return $this->elementTypeNameGenerator->getTypeNameCombination($target, true);
}
} }
//Target does not have a name //Target does not have a name