From d3e323b7dd12a8a9938165db48f63a010da72b89 Mon Sep 17 00:00:00 2001 From: Yuriy Bakhtin Date: Fri, 27 Sep 2024 14:42:48 +0300 Subject: [PATCH 1/2] Refresh the updated_at timestamp of invitation after resend it (#7232) --- CHANGELOG.md | 1 + protected/humhub/modules/user/models/Invite.php | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5e7b2a8ff8..d8207db74c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,7 @@ HumHub Changelog - Fix #7222: Fix rendering of checkbox on MacOS and iOS - Fix #7225: Fix module JS config initialisation on AJAX request - Fix #7227: Fix search reindexing after create new content +- Fix #7232: Refresh the updated_at timestamp of invitation after resend it 1.16.2 (September 5, 2024) -------------------------- diff --git a/protected/humhub/modules/user/models/Invite.php b/protected/humhub/modules/user/models/Invite.php index c0be3498fc..418a282d1d 100644 --- a/protected/humhub/modules/user/models/Invite.php +++ b/protected/humhub/modules/user/models/Invite.php @@ -227,6 +227,11 @@ class Invite extends ActiveRecord Yii::$app->setLanguage(Yii::$app->user->language); } + if ($result) { + // Refresh the updated_at timestamp + $this->save(); + } + return $result; } From 307764b02cf673de405090f8397313f6b3b68ddc Mon Sep 17 00:00:00 2001 From: Yuriy Bakhtin Date: Thu, 3 Oct 2024 18:55:56 +0300 Subject: [PATCH 2/2] Fix file visibility for object with viewable interface (#7241) --- CHANGELOG.md | 1 + protected/humhub/modules/file/models/File.php | 8 +++++--- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d8207db74c..5504cc0fa5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,6 +12,7 @@ HumHub Changelog - Fix #7225: Fix module JS config initialisation on AJAX request - Fix #7227: Fix search reindexing after create new content - Fix #7232: Refresh the updated_at timestamp of invitation after resend it +- Fix #7241: Fix file visibility for object with viewable interface 1.16.2 (September 5, 2024) -------------------------- diff --git a/protected/humhub/modules/file/models/File.php b/protected/humhub/modules/file/models/File.php index 563957cc3d..e734cd976f 100644 --- a/protected/humhub/modules/file/models/File.php +++ b/protected/humhub/modules/file/models/File.php @@ -297,13 +297,15 @@ class File extends FileCompat implements ViewableInterface public function canView($user = null): bool { $object = $this->getPolymorphicRelation(); - if ($object instanceof ContentActiveRecord || $object instanceof ContentAddonActiveRecord) { - return $object->content->canView($user); - } + if ($object instanceof ViewableInterface) { return $object->canView($user); } + if ($object instanceof ContentActiveRecord || $object instanceof ContentAddonActiveRecord) { + return $object->content->canView($user); + } + return true; }