diff --git a/CHANGELOG.md b/CHANGELOG.md index 7d80bd206b..f3235374ca 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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) diff --git a/protected/humhub/modules/stream/actions/Stream.php b/protected/humhub/modules/stream/actions/Stream.php index 1407efbd61..feecdfe33d 100644 --- a/protected/humhub/modules/stream/actions/Stream.php +++ b/protected/humhub/modules/stream/actions/Stream.php @@ -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']); + } }