Fixed an exception on part tables, when an attachment is external.

This commit is contained in:
Jan Böhmer 2019-11-10 19:58:35 +01:00
parent 2f1ff14a54
commit 09995330af
2 changed files with 4 additions and 3 deletions

View file

@ -38,7 +38,7 @@ class PartAttachmentsColumn extends AbstractColumn
protected $FAIconGenerator;
protected $urlGenerator;
public function __construct(FAIconGenerator $FAIconGenerator, AttachmentURLGenerator $urlGenerator)
public function __construct(FAIconGenerator $FAIconGenerator, EntityURLGenerator $urlGenerator)
{
$this->FAIconGenerator = $FAIconGenerator;
$this->urlGenerator = $urlGenerator;
@ -74,7 +74,7 @@ class PartAttachmentsColumn extends AbstractColumn
/** @var Attachment $attachment */
$tmp .= sprintf(
'<a href="%s" title="%s" class="attach-table-icon" target="_blank" rel="noopener" data-no-ajax>%s</a>',
$this->urlGenerator->getViewURL($attachment),
$this->urlGenerator->viewURL($attachment),
htmlspecialchars($attachment->getName()) . ': ' . htmlspecialchars($attachment->getFilename()),
$this->FAIconGenerator->generateIconHTML(
$this->FAIconGenerator->fileExtensionToFAType($attachment->getExtension()),