mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2025-06-21 09:35:49 +02:00
Fixed an exception in log page.
This commit is contained in:
parent
246a96668b
commit
b27079e421
1 changed files with 10 additions and 5 deletions
|
@ -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) {
|
||||||
|
try {
|
||||||
return sprintf(
|
return sprintf(
|
||||||
'<a href="%s">%s</a>',
|
'<a href="%s">%s</a>',
|
||||||
$this->entityURLGenerator->infoURL($target),
|
$this->entityURLGenerator->infoURL($target),
|
||||||
$this->elementTypeNameGenerator->getTypeNameCombination($target, true)
|
$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
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue