Remove topic table query from post_cardform.php

The forum module (topic table) does not exist. Remove the comment count
query to prevent a fatal crash when loading a post detail page.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-06-22 11:52:42 +02:00
parent 887ac6a4bb
commit 952b3e2efc

View File

@@ -156,7 +156,6 @@ if ($isNew) {
'id' => 0,
// Weitere Felder kannst du hier ggf. ergänzen
];
$commentCount = 0;
$versionCount = 0;
$currentVersion = [
'id' => 0,
@@ -199,16 +198,6 @@ if ($isNew) {
}
// Anzahl Kommentare ermitteln
$sqlCountComments = "SELECT COUNT(*) AS commentCount FROM topic WHERE knowledgecenter_post_id = $postId";
$resCountComments = mysqli_query($GLOBALS['mysql_con'], $sqlCountComments);
if ($resCountComments && mysqli_num_rows($resCountComments) > 0) {
$rowCount = mysqli_fetch_assoc($resCountComments);
$commentCount = (int) $rowCount['commentCount'];
} else {
$commentCount = 0;
}
// Anzahl Versionen für die aktuell ausgewählte Sprache ermitteln
$sqlCountVersions = "SELECT COUNT(*) AS versionCount FROM knowledgecenter_post_versions WHERE post_id = $postId AND language_id = $languageId";
$resCountVersions = mysqli_query($GLOBALS['mysql_con'], $sqlCountVersions);