mirror of
https://github.com/silverstripe/silverstripe-blog
synced 2024-10-22 11:05:58 +02:00
Fix blog archive widget bug
Fixes blog archive widget bug to only get the archive months for the blog linked to in this widget.
This commit is contained in:
parent
ae4bcebc46
commit
ce1dee51d4
@ -100,7 +100,8 @@ class BlogArchiveWidget extends Widget
|
|||||||
$query = SQLSelect::create($fields, '"BlogPost' . $suffix . '"')
|
$query = SQLSelect::create($fields, '"BlogPost' . $suffix . '"')
|
||||||
->addGroupBy($publishDate)
|
->addGroupBy($publishDate)
|
||||||
->addOrderBy('"PublishDate" DESC')
|
->addOrderBy('"PublishDate" DESC')
|
||||||
->addWhere(array('"PublishDate" <= ?' => SS_Datetime::now()->Format('Y-m-d H:i:s')));
|
->addLeftJoin('SiteTree' . $suffix, '"SiteTree' . $suffix . '"."ID" = "BlogPost' . $suffix . '"."ID"')
|
||||||
|
->addWhere(array('"PublishDate" <= ?' => SS_Datetime::now()->Format('Y-m-d H:i:s'), 'SiteTree' . $suffix . '.ParentID' => $this->BlogID));
|
||||||
|
|
||||||
$posts = $query->execute();
|
$posts = $query->execute();
|
||||||
$result = new ArrayList();
|
$result = new ArrayList();
|
||||||
|
Loading…
Reference in New Issue
Block a user