svalavuo 4 днів тому
батько
коміт
126cab43ac
1 змінених файлів з 10 додано та 0 видалено
  1. 10 0
      includes/wordpress_import.php

+ 10 - 0
includes/wordpress_import.php

@@ -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("