From 53b94e856c353393d612c88b775974ae9da7c000 Mon Sep 17 00:00:00 2001 From: Richard Dern Date: Mon, 22 Apr 2024 21:47:26 +0200 Subject: [PATCH] Fix: When no variant is claimed, use base attachment as variant --- app/Classes/AttachmentsManager.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/Classes/AttachmentsManager.php b/app/Classes/AttachmentsManager.php index 3142f88..eb49409 100644 --- a/app/Classes/AttachmentsManager.php +++ b/app/Classes/AttachmentsManager.php @@ -158,7 +158,7 @@ public function replaceAttachmentsInMarkdown(string $markdown) foreach ($matches[1] as $index => $ref) { try { - $component = $this->getComponentByRef($ref, 'article'); + $component = $this->getComponentByRef($ref); } catch (Exception $ex) { continue; } @@ -188,6 +188,8 @@ public function getComponentByRef(string $ref, ?string $filter = null) if (!empty($filter)) { $variant['filename'] = $this->getVariantFullPath($ref, $filter); + } else { + $variant = $attachment; } $component = $this->getBladeComponent($attachment, $variant);