Merge branch '3.12' into 3

This commit is contained in:
github-actions 2023-09-30 12:28:23 +00:00
commit 3b6a519b39

View File

@ -28,13 +28,17 @@ class BlogPostFilter extends DataExtension
*/ */
public function augmentSQL(SQLSelect $query, DataQuery $dataQuery = null) public function augmentSQL(SQLSelect $query, DataQuery $dataQuery = null)
{ {
$stage = Versioned::get_stage();
if (Controller::has_curr() && Controller::curr() instanceof LeftAndMain) { if (Controller::has_curr() && Controller::curr() instanceof LeftAndMain) {
return; 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( $query->addWhere(sprintf(
'"PublishDate" < \'%s\'', '"PublishDate" < \'%s\'',
Convert::raw2sql(DBDatetime::now()) Convert::raw2sql(DBDatetime::now())