From cd660ef242bb9a9fb11986b8cf1d5e60c613c9b9 Mon Sep 17 00:00:00 2001 From: Yuriy Bakhtin Date: Wed, 24 Aug 2022 23:43:30 +0300 Subject: [PATCH] Fix updating of user visibility (#5851) --- protected/humhub/modules/user/models/forms/AccountSettings.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/protected/humhub/modules/user/models/forms/AccountSettings.php b/protected/humhub/modules/user/models/forms/AccountSettings.php index cfdc9ceb84..bf593bef0f 100644 --- a/protected/humhub/modules/user/models/forms/AccountSettings.php +++ b/protected/humhub/modules/user/models/forms/AccountSettings.php @@ -39,7 +39,7 @@ class AccountSettings extends Model [['timeZone'], 'in', 'range' => \DateTimeZone::listIdentifiers()], ['language', 'in', 'range' => array_keys(Yii::$app->i18n->getAllowedLanguages())], ['visibility', 'in', 'range' => array_keys($this->getVisibilityOptions()), - 'when' => function (self $model) {return $model->isVisibilityEditable();}], + 'when' => function (self $model) {return $model->isVisibilityViewable() && $model->isVisibilityEditable();}], ]; }