mirror of
https://github.com/humhub/humhub.git
synced 2025-01-17 14:18:27 +01:00
Fix content search order after restoring from cache (#7017)
* Fix content search order after restoring from cache * Update CHANGELOG-DEV.md
This commit is contained in:
parent
78a5c87da9
commit
5c0fea3089
@ -28,6 +28,7 @@ HumHub Changelog
|
||||
- Fix #7011: Fixed performance issue in `Members::getPrivilegedUserIds`
|
||||
- Enh #7010: Rich text tables: Vertical align top instead of middle
|
||||
- Enh #5310: Mobile - Zooming into pictures
|
||||
- Fix #7017: Fix content search order after restoring from cache
|
||||
|
||||
1.16.0-beta.2 (April 9, 2024)
|
||||
-----------------------------
|
||||
|
@ -10,6 +10,7 @@ namespace humhub\modules\content\search;
|
||||
|
||||
use humhub\modules\content\models\Content;
|
||||
use yii\data\Pagination;
|
||||
use yii\db\Expression;
|
||||
|
||||
/**
|
||||
* SearchResultSet
|
||||
@ -41,6 +42,10 @@ class ResultSet
|
||||
$this->pagination = $data['pagination'];
|
||||
$this->results = empty($data['results'])
|
||||
? []
|
||||
: Content::find()->where(['IN', 'id', $data['results']])->all();
|
||||
: Content::find()
|
||||
->where(['IN', 'id', $data['results']])
|
||||
// Restore an original order what was before serializing
|
||||
->orderBy([new Expression('FIELD(id, ' . implode(',', $data['results']) . ')')])
|
||||
->all();
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user