mirror of
https://github.com/flarum/core.git
synced 2025-08-07 00:47:00 +02:00
Don't set flags relationship on non-hydrated posts
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user