diff --git a/src/Flarum/Api/Actions/Posts/Create.php b/src/Flarum/Api/Actions/Posts/Create.php index c6864b048..f1c3943be 100644 --- a/src/Flarum/Api/Actions/Posts/Create.php +++ b/src/Flarum/Api/Actions/Posts/Create.php @@ -20,7 +20,7 @@ class Create extends Base // the post content, and the author's user account. Let's set up a // command with this information. We also fire an event to allow plugins // to add data to the command. - $discussionId = $this->input('posts.links.discussions'); + $discussionId = $this->input('posts.links.discussion'); $content = $this->input('posts.content'); $command = new PostReplyCommand($discussionId, $content, User::current()); diff --git a/src/Flarum/Core/Posts/CommentPost.php b/src/Flarum/Core/Posts/CommentPost.php index 01f178162..32999f863 100755 --- a/src/Flarum/Core/Posts/CommentPost.php +++ b/src/Flarum/Core/Posts/CommentPost.php @@ -15,7 +15,7 @@ class CommentPost extends Post parent::boot(); static::saving(function ($post) { - $post->number = $post->discussion->number_index++; + $post->number = ++$post->discussion->number_index; $post->discussion->save(); }); }