Skip to content

Commit

Permalink
Merge pull request #78 from humhub/fix/75-clearing-reported-content
Browse files Browse the repository at this point in the history
Display only published contents
  • Loading branch information
luke- authored May 1, 2024
2 parents 58702a5 + 0ad9e21 commit 14c1cc4
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 4 deletions.
6 changes: 4 additions & 2 deletions components/ActiveQueryReportContent.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
namespace humhub\modules\reportcontent\components;

use humhub\modules\content\components\ContentContainerActiveRecord;
use humhub\modules\content\models\Content;
use Yii;
use yii\db\ActiveQuery;
use yii\db\Expression;
Expand All @@ -24,9 +25,10 @@ public function readable(?ContentContainerActiveRecord $container = null): self
$this->andWhere(['system_admin_only' => 0]);
}

$this->joinWith('content')->andWhere(['content.state' => Content::STATE_PUBLISHED]);

if ($container !== null) {
$this->joinWith('content')
->andWhere(['content.contentcontainer_id' => $container->contentcontainer_id])
$this->andWhere(['content.contentcontainer_id' => $container->contentcontainer_id])
->andWhere(['not', ['content.created_by' => Yii::$app->user->id]]);
}

Expand Down
4 changes: 4 additions & 0 deletions docs/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
Changelog
=========

1.1.0 (Unreleased)
----------------------
- Fix #75: Display only published contents

1.0.4 (Unreleased)
----------------------
- Enh #71: Tests for `next` version
Expand Down
4 changes: 2 additions & 2 deletions module.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"profanity filter",
"abuse"
],
"version": "1.0.4",
"version": "1.1.0",
"authors": [
{
"name": "HumHub Staff"
Expand All @@ -21,7 +21,7 @@
"homepage": "https://github.com/humhub/reportcontent",
"license": "AGPL-3.0-or-later",
"humhub": {
"minVersion": "1.13"
"minVersion": "1.14"
},
"screenshots": ["resources/screen1.PNG", "resources/screen2.PNG", "resources/screen3.PNG", "resources/screen4.PNG", "resources/screen5.PNG"]
}

0 comments on commit 14c1cc4

Please sign in to comment.