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:
@@ -156,7 +156,6 @@ if ($isNew) {
|
|||||||
'id' => 0,
|
'id' => 0,
|
||||||
// Weitere Felder kannst du hier ggf. ergänzen
|
// Weitere Felder kannst du hier ggf. ergänzen
|
||||||
];
|
];
|
||||||
$commentCount = 0;
|
|
||||||
$versionCount = 0;
|
$versionCount = 0;
|
||||||
$currentVersion = [
|
$currentVersion = [
|
||||||
'id' => 0,
|
'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
|
// 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";
|
$sqlCountVersions = "SELECT COUNT(*) AS versionCount FROM knowledgecenter_post_versions WHERE post_id = $postId AND language_id = $languageId";
|
||||||
$resCountVersions = mysqli_query($GLOBALS['mysql_con'], $sqlCountVersions);
|
$resCountVersions = mysqli_query($GLOBALS['mysql_con'], $sqlCountVersions);
|
||||||
|
|||||||
Reference in New Issue
Block a user