mirror of
https://github.com/flarum/core.git
synced 2025-08-10 10:24:46 +02:00
Don't set flags relationship on non-hydrated posts
This commit is contained in:
@@ -119,10 +119,12 @@ class AddPostFlagsRelationship
|
|||||||
$postsWithPermission = [];
|
$postsWithPermission = [];
|
||||||
|
|
||||||
foreach ($posts as $post) {
|
foreach ($posts as $post) {
|
||||||
$post->setRelation('flags', null);
|
if (is_object($post)) {
|
||||||
|
$post->setRelation('flags', null);
|
||||||
|
|
||||||
if ($actor->can('viewFlags', $post->discussion)) {
|
if ($actor->can('viewFlags', $post->discussion)) {
|
||||||
$postsWithPermission[] = $post;
|
$postsWithPermission[] = $post;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user