diff --git a/extensions/approval/src/Listener/UnapproveNewContent.php b/extensions/approval/src/Listener/UnapproveNewContent.php index 8f95dd951..bbd3bcb31 100644 --- a/extensions/approval/src/Listener/UnapproveNewContent.php +++ b/extensions/approval/src/Listener/UnapproveNewContent.php @@ -24,7 +24,7 @@ class UnapproveNewContent $post = $event->post; if (! $post->exists) { - $ability = $post->discussion->post_number_index == 0 ? 'startWithoutApproval' : 'replyWithoutApproval'; + $ability = $post->discussion->first_post_id === null ? 'startWithoutApproval' : 'replyWithoutApproval'; if ($event->actor->can($ability, $post->discussion)) { if ($post->is_approved === null) { diff --git a/framework/core/src/Discussion/Discussion.php b/framework/core/src/Discussion/Discussion.php index db96639ef..544b7f042 100644 --- a/framework/core/src/Discussion/Discussion.php +++ b/framework/core/src/Discussion/Discussion.php @@ -30,7 +30,7 @@ use Illuminate\Support\Str; * @property string $slug * @property int $comment_count * @property int $participant_count - * @property int $post_number_index + * @property int $post_number_index !!DEPRECATED!! * @property \Carbon\Carbon $created_at * @property int|null $user_id * @property int|null $first_post_id diff --git a/framework/core/src/Post/Command/PostReplyHandler.php b/framework/core/src/Post/Command/PostReplyHandler.php index 40a52de7f..96de698d0 100644 --- a/framework/core/src/Post/Command/PostReplyHandler.php +++ b/framework/core/src/Post/Command/PostReplyHandler.php @@ -74,7 +74,7 @@ class PostReplyHandler // If this is the first post in the discussion, it's technically not a // "reply", so we won't check for that permission. - if ($discussion->post_number_index > 0) { + if ($discussion->first_post_id !== null) { $actor->assertCan('reply', $discussion); }