Skip to content

Commit

Permalink
Agenda: Validate attachment to update in course event - refs BT#19392
Browse files Browse the repository at this point in the history
  • Loading branch information
AngelFQC committed Jan 4, 2022
1 parent 02d2541 commit 82b22e9
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion main/calendar/agenda.php
Expand Up @@ -272,7 +272,7 @@ function add_image_form() {
$endDate = $values['date_range_end'];

$sendAttachment = isset($_FILES) && !empty($_FILES);
$attachmentList = $sendAttachment ? $_FILES : null;
$attachmentList = $sendAttachment ? $_FILES : [];
$attachmentCommentList = $values['legend'] ?? '';
$comment = $values['comment'] ?? '';
$notificationCount = $_REQUEST['notification_count'] ?? [];
Expand Down
4 changes: 4 additions & 0 deletions main/inc/lib/agenda.lib.php
Expand Up @@ -1137,6 +1137,10 @@ public function editEvent(
if (isset($attachmentArray) && !empty($attachmentArray)) {
$counter = 0;
foreach ($attachmentArray as $attachmentItem) {
if (empty($attachmentItems['id'])) {
continue;
}

$this->updateAttachment(
$attachmentItem['id'],
$id,
Expand Down

0 comments on commit 82b22e9

Please sign in to comment.