Skip to content

Commit

Permalink
Merge branch '4.1' into 4
Browse files Browse the repository at this point in the history
  • Loading branch information
github-actions[bot] committed Sep 30, 2023
2 parents f4ae122 + fe638a0 commit 685ccf3
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 685ccf3

Please sign in to comment.