From dafc149bba35133cca7f1b797730582200283354 Mon Sep 17 00:00:00 2001 From: Caroline Schulte Date: Mon, 15 Jun 2026 22:50:55 +0200 Subject: [PATCH] =?UTF-8?q?Antwortm=C3=B6glichkeit?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- php/model/DatabaseCommentManager.php | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/php/model/DatabaseCommentManager.php b/php/model/DatabaseCommentManager.php index 3bba78c..df4124c 100644 --- a/php/model/DatabaseCommentManager.php +++ b/php/model/DatabaseCommentManager.php @@ -162,11 +162,22 @@ class DatabaseCommentManager implements CommentManagerDAO $db = $this->getConnection(); $sql = " - SELECT * - FROM comments - WHERE article_id = :articleId - ORDER BY created ASC - "; + SELECT + id, + article_id, + CASE + WHEN parent_comment_id IS NULL THEN NULL + WHEN parent_comment_id = '' THEN NULL + WHEN parent_comment_id = 0 THEN NULL + ELSE parent_comment_id + END AS parent_comment_id, + author, + content, + created + FROM comments + WHERE article_id = :articleId + ORDER BY created ASC + "; $command = $db->prepare($sql);