Skip to content

Commit

Permalink
Merge branch '3' into 4.0
Browse files Browse the repository at this point in the history
  • Loading branch information
github-actions[bot] committed Sep 30, 2023
2 parents 0f93f6a + 3b6a519 commit 38bad2d
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/Model/BlogPostFilter.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,17 @@ class BlogPostFilter extends DataExtension
*/
public function augmentSQL(SQLSelect $query, DataQuery $dataQuery = null)
{
$stage = Versioned::get_stage();

if (Controller::has_curr() && Controller::curr() instanceof LeftAndMain) {
return;
}

if ($stage == 'Live' || !Permission::check('VIEW_DRAFT_CONTENT')) {
if (Versioned::get_stage() === Versioned::LIVE ||
(
Versioned::get_draft_site_secured() &&
!Permission::check('VIEW_DRAFT_CONTENT')
)
) {
$query->addWhere(sprintf(
'"PublishDate" < \'%s\'',
Convert::raw2sql(DBDatetime::now())
Expand Down

0 comments on commit 38bad2d

Please sign in to comment.