Skip to content

Commit 39219c5

Browse files
authored
Calendar: Fix failing attachment upload in Calendar::editEvent()
Author: @TheTomcat14
1 parent d17ec70 commit 39219c5

File tree

1 file changed

+15
-10
lines changed

1 file changed

+15
-10
lines changed

main/inc/lib/agenda.lib.php

Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1201,17 +1201,22 @@ public function editEvent(
12011201
if (isset($attachmentArray) && !empty($attachmentArray)) {
12021202
$counter = 0;
12031203
foreach ($attachmentArray as $attachmentItem) {
1204-
if (empty($attachmentItems['id'])) {
1205-
continue;
1204+
if (empty($attachmentItem['id'])) {
1205+
$this->addAttachment(
1206+
$id,
1207+
$attachmentItem,
1208+
$attachmentCommentList[$counter],
1209+
$this->course
1210+
);
1211+
} else {
1212+
$this->updateAttachment(
1213+
$attachmentItem['id'],
1214+
$id,
1215+
$attachmentItem,
1216+
$attachmentCommentList[$counter],
1217+
$this->course
1218+
);
12061219
}
1207-
1208-
$this->updateAttachment(
1209-
$attachmentItem['id'],
1210-
$id,
1211-
$attachmentItem,
1212-
$attachmentCommentList[$counter],
1213-
$this->course
1214-
);
12151220
$counter++;
12161221
}
12171222
}

0 commit comments

Comments
 (0)