Fix Activity Mail QueryParams on console mode (#4986)

This commit is contained in:
Yuriy Bakhtin 2021-03-31 14:22:01 +03:00 committed by GitHub
parent 26d7e2667a
commit 168ab6483c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 21 additions and 3 deletions

View File

@ -9,6 +9,7 @@ HumHub Changelog
- Enh #4960: Added “codeception/module-rest” for testing of REST API modules
- Enh #4967: Module update broken with expired licence key
- Enh #4972: Fix enabling to send notification on remove user from group
- Fix #4985: Fix Activity Mail QueryParams on console mode
1.8.1 (March 12, 2021)

View File

@ -8,6 +8,7 @@
namespace humhub\modules\stream\actions;
use humhub\components\Request;
use humhub\modules\stream\events\StreamResponseEvent;
use humhub\modules\user\models\User;
use Yii;
@ -189,9 +190,7 @@ abstract class Stream extends Action
$this->user = Yii::$app->user->identity;
}
$streamQueryParams = Yii::$app->request->getQueryParam('StreamQuery');
if (empty($streamQueryParams['contentId'])) {
if (!$this->isSingleContentRequest()) {
$this->excludes = array_merge($this->excludes, Yii::$app->getModule('stream')->streamExcludes);
}
@ -433,4 +432,22 @@ abstract class Stream extends Action
{
return $this->streamQuery;
}
/**
* @return bool
*/
private function isSingleContentRequest()
{
if (Yii::$app->request->isConsoleRequest) {
return false;
}
if (!(Yii::$app->request instanceof Request)) {
return false;
}
$streamQueryParams = Yii::$app->request->getQueryParam('StreamQuery');
return !empty($streamQueryParams['contentId']);
}
}