mirror of
https://github.com/flarum/framework.git
synced 2024-11-23 16:48:57 +08:00
Don't set flags relationship on non-hydrated posts
This commit is contained in:
parent
dc6eb4d4ad
commit
8a1c5cf24c
|
@ -119,10 +119,12 @@ class AddPostFlagsRelationship
|
|||
$postsWithPermission = [];
|
||||
|
||||
foreach ($posts as $post) {
|
||||
$post->setRelation('flags', null);
|
||||
if (is_object($post)) {
|
||||
$post->setRelation('flags', null);
|
||||
|
||||
if ($actor->can('viewFlags', $post->discussion)) {
|
||||
$postsWithPermission[] = $post;
|
||||
if ($actor->can('viewFlags', $post->discussion)) {
|
||||
$postsWithPermission[] = $post;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user