Skip to content
This repository has been archived by the owner on Dec 1, 2023. It is now read-only.

Commit

Permalink
Merge branch 'release/1.0.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
malte-christian committed Apr 13, 2016
2 parents a83d212 + 395af79 commit 5eca3aa
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 7 deletions.
7 changes: 6 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,13 @@
# Changelog

## 1.0.0 (April 13, 2016)

### Fixed
- Add roles check to feed action

## 0.11.2 (April 7, 2016)

### FIXED
### Fixed
- Fixed update URL after comment
- Fixed different prefixes with SQLLite
- Fixed SQLite collations
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "pagekit/blog",
"type": "pagekit-extension",
"version": "0.11.2",
"version": "1.0.0",
"title": "Blog",
"description": "A blog extensions with a built-in comment system.",
"license": "MIT",
Expand Down
4 changes: 3 additions & 1 deletion src/Controller/SiteController.php
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,9 @@ public function feedAction($type = '')
$feed->setDate($last->modified);
}

foreach (Post::where(['status = ?', 'date < ?'], [Post::STATUS_PUBLISHED, new \DateTime])->related('user')->limit($this->blog->config('feed.limit'))->orderBy('date', 'DESC')->get() as $post) {
foreach (Post::where(['status = ?', 'date < ?'], [Post::STATUS_PUBLISHED, new \DateTime])->where(function ($query) {
return $query->where('roles IS NULL')->whereInSet('roles', App::user()->roles, false, 'OR');
})->related('user')->limit($this->blog->config('feed.limit'))->orderBy('date', 'DESC')->get() as $post) {
$url = App::url('@blog/id', ['id' => $post->id], 0);
$feed->addItem(
$feed->createItem([
Expand Down
5 changes: 1 addition & 4 deletions src/Model/PostModelTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,7 @@ public static function updateCommentInfo($id)
{
$query = Comment::where(['post_id' => $id, 'status' => Comment::STATUS_APPROVED]);

self::where(compact('id'))->update([
'comment_count' => $query->count()
]
);
self::where(compact('id'))->update(['comment_count' => $query->count()]);
}

/**
Expand Down

0 comments on commit 5eca3aa

Please sign in to comment.