|
|
@@ -437,6 +437,16 @@ class WordPressImport {
|
|
|
$publicationMap = [];
|
|
|
|
|
|
if (!empty($postIds)) {
|
|
|
+ // Test if wp_post_id column exists
|
|
|
+ try {
|
|
|
+ $testStmt = $this->targetDb->query("SELECT wp_post_id FROM publications LIMIT 1");
|
|
|
+ $this->log("wp_post_id column exists in publications table");
|
|
|
+ } catch (Exception $e) {
|
|
|
+ $this->log("Error: wp_post_id column does not exist in publications table: " . $e->getMessage(), 'error');
|
|
|
+ $this->log("Skipping comments import - publications table needs wp_post_id column", 'error');
|
|
|
+ return ['imported' => 0, 'skipped' => count($comments)];
|
|
|
+ }
|
|
|
+
|
|
|
$placeholders = str_repeat('?,', count($postIds) - 1) . '?';
|
|
|
$this->log("Executing publication mapping query with " . count($postIds) . " post IDs");
|
|
|
$pubStmt = $this->targetDb->query("
|