Fix caching of space permissions in user stream (#7358)

This commit is contained in:
Yuriy Bakhtin 2024-12-18 15:19:03 +01:00 committed by GitHub
parent 34bdcadb0d
commit 887cf5f1ed
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 5 additions and 2 deletions

View File

@ -19,6 +19,7 @@ HumHub Changelog
- Fix #7319: Display correct profile field value in user subtitle
- Fix #7322: Always allow invitation by link from Administration. Implement separate invitation by link from People.
- Enh #7335: Update GitHub workflow versions
- Fix #7351: Fix caching of space permissions in user stream
1.16.2 (September 5, 2024)
--------------------------

View File

@ -245,8 +245,10 @@ class PermissionManager extends Component
// recorded group id will not be fetched again
$this->_groupPermissions += array_fill_keys($ids, []);
$result = Yii::$app->runtimeCache->getOrSet(__METHOD__ . implode(',', $ids), function () use ($ids) {
return $this->getQuery()->andWhere(['group_id' => $ids])->all();
$query = $this->getQuery()->andWhere(['group_id' => $ids]);
$cacheKey = __METHOD__ . sha1($query->createCommand()->getRawSql());
$result = Yii::$app->runtimeCache->getOrSet($cacheKey, function () use ($query) {
return $query->all();
});
foreach ($result as $group) {