diff --git a/framework/core/src/Api/Serializers/BaseSerializer.php b/framework/core/src/Api/Serializers/BaseSerializer.php index dc3d1a9b4..bc27496fb 100644 --- a/framework/core/src/Api/Serializers/BaseSerializer.php +++ b/framework/core/src/Api/Serializers/BaseSerializer.php @@ -55,7 +55,7 @@ abstract class BaseSerializer extends SerializerAbstract $data = $relation($model, $include); } else { if ($include) { - $data = $model->getRelation($relation); + $data = $model->$relation; } elseif ($many) { $relationIds = $relation.'_ids'; $data = isset($model->$relationIds) ? $model->$relationIds : $model->$relation()->lists('id'); diff --git a/framework/core/src/Api/Serializers/DiscussionSerializer.php b/framework/core/src/Api/Serializers/DiscussionSerializer.php index f013d9805..e865609c2 100644 --- a/framework/core/src/Api/Serializers/DiscussionSerializer.php +++ b/framework/core/src/Api/Serializers/DiscussionSerializer.php @@ -13,7 +13,7 @@ class DiscussionSerializer extends DiscussionBasicSerializer $attributes = parent::attributes($discussion); $user = $this->actor->getUser(); - $state = $discussion->stateFor($user); + $state = $discussion->state; $attributes += [ 'commentsCount' => (int) $discussion->comments_count, diff --git a/framework/core/src/Core/Support/Locked.php b/framework/core/src/Core/Support/Locked.php index 628e59bcb..cf5d098a4 100644 --- a/framework/core/src/Core/Support/Locked.php +++ b/framework/core/src/Core/Support/Locked.php @@ -34,6 +34,8 @@ trait Locked return $can; } } + + return false; } /**