From a33753581e18aa1fbd9100154b7f98f6080d0d56 Mon Sep 17 00:00:00 2001 From: Theofilos Intzoglou Date: Mon, 6 Jan 2025 16:13:03 +0200 Subject: [PATCH] Check if $attachment_id[$i] exists --- attachments_plugin_framework/src/PlgAttachmentsFramework.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/attachments_plugin_framework/src/PlgAttachmentsFramework.php b/attachments_plugin_framework/src/PlgAttachmentsFramework.php index c17c48e3..dd9d0ced 100644 --- a/attachments_plugin_framework/src/PlgAttachmentsFramework.php +++ b/attachments_plugin_framework/src/PlgAttachmentsFramework.php @@ -962,7 +962,7 @@ public function insertAttachmentsList(&$content, $parent_id, $parent_entity) ->getMVCFactory(); /** @var \JMCameron\Component\Attachments\Site\Controller\AttachmentsController $controller */ $controller = $mvc->createController('Attachments', 'Site', [], $this->app, $this->app->getInput()); - $attachments_list = $controller->displayString($parent_id, $this->parent_type, $parent_entity, null, true, true, false, $from, $attachment_id[$i]); + $attachments_list = $controller->displayString($parent_id, $this->parent_type, $parent_entity, null, true, true, false, $from, $attachment_id[$i] ?? null); // If the attachments list is empty, insert an empty div for it if ($attachments_list == '')