mirror of
https://github.com/flarum/framework.git
synced 2025-04-25 06:04:04 +08:00
feat: deprecate discussion post_number_index
field.
This commit is contained in:
parent
e25c53c00f
commit
00b9151864
@ -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) {
|
||||
|
@ -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
|
||||
|
@ -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);
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user