Skip to content

Commit

Permalink
[K6.3] When click on set all attachments as private it doesn't set
Browse files Browse the repository at this point in the history
private
  • Loading branch information
xillibit committed May 10, 2024
1 parent 461c256 commit 6a60649
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion src/site/src/Controllers/TopicController.php
Original file line number Diff line number Diff line change
Expand Up @@ -195,8 +195,18 @@ public function setprivate()
if ($attachs_id === null) {
throw new RuntimeException(Text::_('Bad Request'), 400);
}

$attach_ids_final = [];

foreach ($attachs_id as $attach) {
if (\is_array($attach)) {
$attach_ids_final[] = $attach['0'];
} else {
$attach_ids_final[] = $attach;
}
}

foreach ($attachs_id as $id) {
foreach ($attach_ids_final as $id) {
$attachment = KunenaAttachmentHelper::get($id);
$attachment->protected = KunenaAttachment::PROTECTION_PRIVATE;
$attachment->save();
Expand Down

0 comments on commit 6a60649

Please sign in to comment.