mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2025-06-21 01:25:55 +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\AbstractNamedDBElement;
|
||||
use App\Entity\LogSystem\AbstractLogEntry;
|
||||
use App\Exceptions\EntityNotSupportedException;
|
||||
use App\Services\ElementTypeNameGenerator;
|
||||
use App\Services\EntityURLGenerator;
|
||||
use Doctrine\ORM\EntityManagerInterface;
|
||||
|
@ -71,11 +72,15 @@ class LogEntryTargetColumn extends AbstractColumn
|
|||
|
||||
//The element is existing
|
||||
if ($target instanceof AbstractNamedDBElement) {
|
||||
try {
|
||||
return sprintf(
|
||||
'<a href="%s">%s</a>',
|
||||
$this->entityURLGenerator->infoURL($target),
|
||||
$this->elementTypeNameGenerator->getTypeNameCombination($target, true)
|
||||
);
|
||||
} catch (EntityNotSupportedException $exception) {
|
||||
return $this->elementTypeNameGenerator->getTypeNameCombination($target, true);
|
||||
}
|
||||
}
|
||||
|
||||
//Target does not have a name
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue