From 3bda0f284f8e415a95fec35cc1581957bcf0762c Mon Sep 17 00:00:00 2001 From: Maurice Renck Date: Tue, 30 Apr 2024 13:43:00 +0200 Subject: [PATCH] fix: comment moderation on non-primary language --- utils/moderation.php | 12 ++++++++---- vendor/composer/installed.php | 8 ++++---- 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/utils/moderation.php b/utils/moderation.php index ecd7b96..c78f5ce 100644 --- a/utils/moderation.php +++ b/utils/moderation.php @@ -18,7 +18,8 @@ public function markAsSpam($pageSlug, $kommentId, $isSpam) throw new Exception('Page not found', 1); } - $fieldData = $targetPage->kommentsInbox()->yaml(); + $fieldData = $baseUtils->getAllCommentsOfPage($targetPage); + $fieldData = $fieldData->toArray(); for ($i = 0; $i < count($fieldData); $i++) { if (isset($fieldData[$i]['id'])) { @@ -58,7 +59,8 @@ public function markAsVerified($pageSlug, $kommentId, $isVerified) throw new Exception('Page not found', 1); } - $fieldData = $targetPage->kommentsInbox()->yaml(); + $fieldData = $baseUtils->getAllCommentsOfPage($targetPage); + $fieldData = $fieldData->toArray(); for ($i = 0; $i < count($fieldData); $i++) { if (isset($fieldData[$i]['id'])) { @@ -92,7 +94,8 @@ public function publish($pageSlug, $kommentId, $publish) throw new Exception('Page not found', 1); } - $fieldData = $targetPage->kommentsInbox()->yaml(); + $fieldData = $baseUtils->getAllCommentsOfPage($targetPage); + $fieldData = $fieldData->toArray(); for ($i = 0; $i < count($fieldData); $i++) { if (isset($fieldData[$i]['id'])) { @@ -126,7 +129,8 @@ public function delete($pageSlug, $kommentId) throw new Exception('Page not found', 1); } - $fieldData = $targetPage->kommentsInbox()->yaml(); + $fieldData = $baseUtils->getAllCommentsOfPage($targetPage); + $fieldData = $fieldData->toArray(); $newFieldData = []; for ($i = 0; $i < count($fieldData); $i++) { diff --git a/vendor/composer/installed.php b/vendor/composer/installed.php index 195b982..644ab1c 100644 --- a/vendor/composer/installed.php +++ b/vendor/composer/installed.php @@ -1,8 +1,8 @@ array( 'name' => 'mauricerenck/komments', - 'pretty_version' => '2.0.1', - 'version' => '2.0.1.0', + 'pretty_version' => '2.0.3', + 'version' => '2.0.3.0', 'reference' => NULL, 'type' => 'kirby-plugin', 'install_path' => __DIR__ . '/../../', @@ -29,8 +29,8 @@ 'dev_requirement' => false, ), 'mauricerenck/komments' => array( - 'pretty_version' => '2.0.1', - 'version' => '2.0.1.0', + 'pretty_version' => '2.0.3', + 'version' => '2.0.3.0', 'reference' => NULL, 'type' => 'kirby-plugin', 'install_path' => __DIR__ . '/../../',