Skip to content

Commit fe01021

Browse files
committed
fix: change field name due to issues
1 parent 766d2ac commit fe01021

File tree

13 files changed

+29
-29
lines changed

13 files changed

+29
-29
lines changed

index.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/CommentVerification.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ public function verifyToken(string $token): string | bool
9191
}
9292

9393
$updateValues = [];
94-
$updateValues['status'] = ($this->verificationAutoPublish === true) ? 'PUBLISHED' : 'VERIFIED';
94+
$updateValues['verification_status'] = ($this->verificationAutoPublish === true) ? 'PUBLISHED' : 'VERIFIED';
9595

9696
if ($this->verificationAutoPublish === true) {
9797
$updateValues['published'] = true;

lib/KommentModeration.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ public function publishComment(string $id): mixed
3636
{
3737
$comment = $this->storage->getSingleComment($id);
3838
$newStatus = $comment->published()->isTrue() ? false : true;
39-
$result = $this->storage->updateComment($id, ['published' => $newStatus, 'status' => $newStatus ? 'PUBLISHED' : 'PENDING']);
39+
$result = $this->storage->updateComment($id, ['published' => $newStatus, 'verification_status' => $newStatus ? 'PUBLISHED' : 'PENDING']);
4040

4141
kirby()->trigger('komments.comment.published', ['comment' => $comment]);
4242

@@ -81,7 +81,7 @@ public function flagCommentsInBatch(string $flag, array $ids = []): mixed
8181
$result = $this->storage->updateCommentsById($ids, ['verified' => true]);
8282
return $result;
8383
case 'published':
84-
$result = $this->storage->updateCommentsById($ids, ['published' => true, 'status' => 'PUBLISHED']);
84+
$result = $this->storage->updateCommentsById($ids, ['published' => true, 'verification_status' => 'PUBLISHED']);
8585
return $result;
8686
}
8787

@@ -109,7 +109,7 @@ public function replyToComment(string $id, array $formData)
109109
authorAvatar: $avatar,
110110
authorEmail: $author->email(),
111111
authorUrl: site()->url(),
112-
status: $publishResult ? 'PUBLISHED' : 'PENDING',
112+
verification_status: $publishResult ? 'PUBLISHED' : 'PENDING',
113113
published: $publishResult,
114114
verified: true,
115115
spamlevel: 0,

lib/Storage.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ public function createComment(
4040
string $authorAvatar,
4141
?string $authorEmail,
4242
string $authorUrl,
43-
string $status,
43+
string $verification_status,
4444
bool $published,
4545
bool $verified,
4646
int $spamlevel,
@@ -60,7 +60,7 @@ public function createComment(
6060
'authorAvatar' => $authorAvatar,
6161
'authorEmail' => $authorEmail,
6262
'authorUrl' => $authorUrl,
63-
'status' => $status,
63+
'verification_status' => $verification_status,
6464
'published' => $published,
6565
'verified' => $verified,
6666
'spamlevel' => $spamlevel,

lib/StorageMarkdown.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ public function convertToStructure(Obj|Collection|Structure $databaseResults): S
172172
authorAvatar: $avatar,
173173
authorEmail: $databaseResult->author_email,
174174
authorUrl: $databaseResult->author_url,
175-
status: $databaseResult->status,
175+
verification_status: $databaseResult->verification_status,
176176
published: $databaseResult->published,
177177
verified: $databaseResult->verified,
178178
spamlevel: $databaseResult->spamlevel,

lib/StoragePhpunit.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ public function convertToStructure(Obj|Collection $databaseResults): Structure
8080
authorAvatar: $databaseResult->author_avatar,
8181
authorEmail: $databaseResult->author_email,
8282
authorUrl: $databaseResult->author_url,
83-
status: $databaseResult->status,
83+
verification_status: $databaseResult->verification_status,
8484
published: $databaseResult->published,
8585
verified: $databaseResult->verified,
8686
spamlevel: $databaseResult->spamlevel,
@@ -116,7 +116,7 @@ private function getCommentMock(array $comment = []): Obj
116116
'authorEmail' => '[email protected]',
117117
'authorUrl' => 'https://example.com',
118118
'published' => true,
119-
'status' => 'PUBLISHED',
119+
'verification_status' => 'PUBLISHED',
120120
'verified' => false,
121121
'spamlevel' => 0,
122122
'language' => null,
@@ -139,7 +139,7 @@ private function getCommentMock(array $comment = []): Obj
139139
'author_email' => $comment['authorEmail'],
140140
'author_url' => $comment['authorUrl'],
141141
'published' => $comment['published'],
142-
'status' => $comment['status'],
142+
'verification_status' => $comment['verification_status'],
143143
'verified' => $comment['verified'],
144144
'spamlevel' => $comment['spamlevel'],
145145
'language' => $comment['language'],

lib/StorageSqlite.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ public function saveComment(Content $comment): bool
5757
{
5858
return $this->database->insert(
5959
'comments',
60-
['id', 'page_uuid', 'parent_id', 'type', 'language', 'content', 'author_name', 'author_avatar', 'author_email', 'author_url', 'published', 'verified', 'spamlevel', 'upvotes', 'downvotes', 'created_at', 'updated_at', 'status'],
60+
['id', 'page_uuid', 'parent_id', 'type', 'language', 'content', 'author_name', 'author_avatar', 'author_email', 'author_url', 'published', 'verified', 'spamlevel', 'upvotes', 'downvotes', 'created_at', 'updated_at', 'verification_status'],
6161
[
6262
$comment->id(),
6363
$comment->pageUuid(),
@@ -76,7 +76,7 @@ public function saveComment(Content $comment): bool
7676
$comment->downvotes(),
7777
$comment->createdAt(),
7878
$comment->createdAt(),
79-
$comment->status(),
79+
$comment->verification_status(),
8080
]
8181
);
8282
}
@@ -157,7 +157,7 @@ public function convertToStructure(Obj|Collection|Structure $databaseResults): S
157157
authorAvatar: $avatar,
158158
authorEmail: $databaseResult->author_email,
159159
authorUrl: $databaseResult->author_url,
160-
status: $databaseResult->status,
160+
verification_status: $databaseResult->verification_status,
161161
published: $databaseResult->published,
162162
verified: $databaseResult->verified,
163163
spamlevel: $databaseResult->spamlevel,

lib/TestCaseMocked.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ function getPageMock($draft = false, $contentEN = [], $contentDE = [])
5252
mentionof: https://komments.test:8890/phpunit
5353
property: KOMMENT
5454
published: 2021-11-10 13:50:00
55-
status: "PENDING"
55+
verification_status: "PENDING"
5656
verified: "false"
5757
id: 1bfffa3f189b3c5b5d6f3ed3271d3342
5858
spamlevel: 0
@@ -70,7 +70,7 @@ function getPageMock($draft = false, $contentEN = [], $contentDE = [])
7070
mentionof: https://komments.test:8890/phpunit
7171
property: KOMMENT
7272
published: 2021-11-10 13:50:00
73-
status: "PENDING"
73+
verification_status: "PENDING"
7474
verified: "true"
7575
id: c62bc1426c1d39eb6d8a6b4f5b3ef3ee
7676
spamlevel: 0
@@ -88,7 +88,7 @@ function getPageMock($draft = false, $contentEN = [], $contentDE = [])
8888
mentionof: https://komments.test:8890/phpunit
8989
property: KOMMENT
9090
published: 2021-11-10 13:50:00
91-
status: "PENDING"
91+
verification_status: "PENDING"
9292
verified: "false"
9393
id: 594a3bdc4947c1a8496d2beb8a065cb1
9494
spamlevel: 100'
@@ -113,7 +113,7 @@ function getPageMock($draft = false, $contentEN = [], $contentDE = [])
113113
mentionof: https://komments.test:8890/phpunit
114114
property: KOMMENT
115115
published: 2021-11-10 13:50:00
116-
status: "PUBLISHED"
116+
verification_status: "PUBLISHED"
117117
verified: "false"
118118
id: 1bfffa3f189b3c5b5d6f3ed3271d3342
119119
spamlevel: 0'
@@ -161,7 +161,7 @@ function getCommentMock(array $comment = []): Obj
161161
'authorEmail' => '[email protected]',
162162
'authorUrl' => 'https://example.com',
163163
'published' => true,
164-
'status' => 'PUBLISHED',
164+
'verification_status' => 'PUBLISHED',
165165
'verified' => false,
166166
'spamlevel' => 0,
167167
'language' => null,
@@ -184,7 +184,7 @@ function getCommentMock(array $comment = []): Obj
184184
'author_email' => $comment['authorEmail'],
185185
'author_url' => $comment['authorUrl'],
186186
'published' => $comment['published'],
187-
'status' => $comment['status'],
187+
'verification_status' => $comment['verification_status'],
188188
'verified' => $comment['verified'],
189189
'spamlevel' => $comment['spamlevel'],
190190
'language' => $comment['language'],
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
ALTER TABLE comments DROP COLUMN status;
2-
ALTER TABLE comments ADD COLUMN status TEXT DEFAULT "PENDING";
2+
ALTER TABLE comments ADD COLUMN verification_status TEXT DEFAULT "PENDING";

plugin/routes.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@
6565
authorAvatar: $receiver->getAvatarFromEmail($formData['email']),
6666
authorEmail: $receiver->getEmail($formData['email']),
6767
authorUrl: $receiver->createSafeString($formData['author_url']),
68-
status: $autoPublish ? 'PUBLISHED' : 'PENDING',
68+
verification_status: $autoPublish ? 'PUBLISHED' : 'PENDING',
6969
published: $autoPublish,
7070
verified: $verified,
7171
spamlevel: $spamlevel,

0 commit comments

Comments
 (0)