From 345a1e91457108b9d77f26e5bc10ace1ff6570f4 Mon Sep 17 00:00:00 2001 From: Yuriy Bakhtin Date: Mon, 10 Jul 2023 10:04:22 +0200 Subject: [PATCH] Display only published content files in the folder "Files from the stream" --- docs/CHANGELOG.md | 1 + models/File.php | 2 ++ 2 files changed, 3 insertions(+) diff --git a/docs/CHANGELOG.md b/docs/CHANGELOG.md index 3c0a206..50aafae 100644 --- a/docs/CHANGELOG.md +++ b/docs/CHANGELOG.md @@ -4,6 +4,7 @@ Changelog 0.16.2 - Unreleased -------------------- - Fix #180: Use icon `fa-unlock` for public files +- Fix #184: Display only published content files in the folder "Files from the stream" 0.16.1 - May 1, 2023 -------------------- diff --git a/models/File.php b/models/File.php index 5a1d0d7..c1c9458 100644 --- a/models/File.php +++ b/models/File.php @@ -420,6 +420,8 @@ public static function getPostedFiles($contentContainer, $filesOrder = ['file.up $query->andWhere(['content.visibility' => Content::VISIBILITY_PUBLIC]); } + $query->andWhere(['content.state' => Content::STATE_PUBLISHED]); + // only accept Posts as the base content, so stuff from sumbmodules like files itsself or gallery will be excluded $query->andWhere( ['or',