|
|
@@ -502,21 +502,22 @@ class WordPressImport {
|
|
|
|
|
|
// Insert comment
|
|
|
$this->log("Executing INSERT for comment: '{$wpComment['comment_content']}' (Post ID: {$wpPostId})");
|
|
|
- $this->targetDb->query(
|
|
|
- "INSERT INTO comments (publication_id, parent_id, name, email, content, status, created_at, admin_reply, wp_comment_id)
|
|
|
- VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?)",
|
|
|
- [
|
|
|
- $publicationId,
|
|
|
- $parentId,
|
|
|
- $wpComment['comment_author'],
|
|
|
- $wpComment['comment_author_email'],
|
|
|
- $wpComment['comment_content'],
|
|
|
- $status,
|
|
|
- $wpComment['comment_date'],
|
|
|
- false,
|
|
|
- $wpComment['comment_ID']
|
|
|
- ]
|
|
|
- );
|
|
|
+ $pdo = $this->targetDb->getConnection();
|
|
|
+ $commentStmt = $pdo->prepare("
|
|
|
+ INSERT INTO comments (publication_id, parent_id, name, email, content, status, created_at, admin_reply, wp_comment_id)
|
|
|
+ VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?)
|
|
|
+ ");
|
|
|
+ $commentStmt->execute([
|
|
|
+ $publicationId,
|
|
|
+ $parentId,
|
|
|
+ $wpComment['comment_author'],
|
|
|
+ $wpComment['comment_author_email'],
|
|
|
+ $wpComment['comment_content'],
|
|
|
+ $status,
|
|
|
+ $wpComment['comment_date'],
|
|
|
+ 0, // Use integer 0 for admin_reply instead of boolean false
|
|
|
+ $wpComment['comment_ID']
|
|
|
+ ]);
|
|
|
|
|
|
$commentId = $this->targetDb->getConnection()->lastInsertId();
|
|
|
|