1
0
mirror of https://github.com/flarum/core.git synced 2025-10-22 04:06:37 +02:00

merges 5.5 and master into next-back

This commit is contained in:
Daniël Klabbers
2017-12-14 01:00:16 +01:00
104 changed files with 1723 additions and 1828 deletions

View File

@@ -152,6 +152,16 @@ class CommentPost extends Post
$this->attributes['content'] = $value ? static::$formatter->parse($value, $this) : null;
}
/**
* Set the parsed/raw content.
*
* @param string $value
*/
public function setParsedContentAttribute($value)
{
$this->attributes['content'] = $value;
}
/**
* Get the content rendered as HTML.
*

View File

@@ -152,7 +152,7 @@ class PostRepository
{
$discussions = $this->getDiscussionsForPosts($ids, $actor);
return Post::whereIn('id', $ids)
$posts = Post::whereIn('id', $ids)
->where(function ($query) use ($discussions, $actor) {
foreach ($discussions as $discussion) {
$query->orWhere(function ($query) use ($discussion, $actor) {
@@ -164,6 +164,12 @@ class PostRepository
$query->orWhereRaw('FALSE');
});
foreach ($posts as $post) {
$post->discussion = $discussions->find($post->discussion_id);
}
return $posts;
}
/**