diff --git a/main/inc/lib/agenda.lib.php b/main/inc/lib/agenda.lib.php index befc9a7911..e70197eb65 100644 --- a/main/inc/lib/agenda.lib.php +++ b/main/inc/lib/agenda.lib.php @@ -1201,17 +1201,22 @@ class Agenda if (isset($attachmentArray) && !empty($attachmentArray)) { $counter = 0; foreach ($attachmentArray as $attachmentItem) { - if (empty($attachmentItems['id'])) { - continue; + if (empty($attachmentItem['id'])) { + $this->addAttachment( + $id, + $attachmentItem, + $attachmentCommentList[$counter], + $this->course + ); + } else { + $this->updateAttachment( + $attachmentItem['id'], + $id, + $attachmentItem, + $attachmentCommentList[$counter], + $this->course + ); } - - $this->updateAttachment( - $attachmentItem['id'], - $id, - $attachmentItem, - $attachmentCommentList[$counter], - $this->course - ); $counter++; } }