Fixed acitvity stream performance (#5018)

* Fixed acitvity stream performance

* Modified CHANGELOG.md
This commit is contained in:
Lucas Bartholemy 2021-04-18 21:17:25 +02:00 committed by GitHub
parent 42ff9f8df4
commit f5679dc944
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 3 deletions

View File

@ -13,6 +13,7 @@ HumHub Changelog
- Fix #4985: Fix Activity Mail QueryParams on console mode
- Fix #4989: Translate profile field title in admin list
- Fix #5002: Fix loading of fixture spaces on tests
- Fix #5018: Activity stream problems with many user accounts
1.8.1 (March 12, 2021)

View File

@ -48,10 +48,11 @@ class ActivityStreamQuery extends ContentContainerStreamQuery
*/
public function afterApplyFilters()
{
if($this->activity) {
$this->channel(self::CHANNEL_ACTIVITY);
if ($this->activity) {
$this->channel = self::CHANNEL_ACTIVITY;
$this->query()->andWhere(['!=', 'user.status', User::STATUS_NEED_APPROVAL]);
// Note: With the extra null check, the query performs much faster than directly against the status field.
$this->query()->andWhere(['OR', 'user.id IS NULL', ['!=', 'user.status', User::STATUS_NEED_APPROVAL]]);
// Exclude own activities
if ($this->user) {