From b856da4337856a4fd2566fe0c252e071cfe199f8 Mon Sep 17 00:00:00 2001 From: githubjeka Date: Mon, 1 Oct 2018 10:46:50 +0300 Subject: [PATCH] Fixed bug for IssueContent::canView(userId) when userId is string --- models/IssueContent.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/models/IssueContent.php b/models/IssueContent.php index c469fa1..a07704e 100644 --- a/models/IssueContent.php +++ b/models/IssueContent.php @@ -27,6 +27,8 @@ public function canView($user = null) { if ($user === null && !\Yii::$app->user->isGuest) { $user = \Yii::$app->user->getIdentity(); + } else if (!$user instanceof User) { + $user = User::findOne(['id' => $user]); } $visibility = (int)$this->visibility;