From: Marcel Werk Date: Thu, 16 Feb 2023 11:19:03 +0000 (+0100) Subject: Fix issue when importing comments from wordpress X-Git-Tag: 5.5.9~1 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=f8ae0b9ed371333abde6d3ef157ce2b5159ffcd4;p=GitHub%2FWoltLab%2Fcom.woltlab.wcf.exporter.git Fix issue when importing comments from wordpress Comments assigned to a parent comment that no longer exists resulted in an error. --- diff --git a/files/lib/system/exporter/WordPress3xExporter.class.php b/files/lib/system/exporter/WordPress3xExporter.class.php index 207b364..903fa9f 100644 --- a/files/lib/system/exporter/WordPress3xExporter.class.php +++ b/files/lib/system/exporter/WordPress3xExporter.class.php @@ -434,6 +434,11 @@ class WordPress3xExporter extends AbstractExporter $parentCommentStatement->execute([$parentID]); $row2 = $parentCommentStatement->fetchArray(); + if ($row2 === false) { + // Skip because parent comment is missing. + break; + } + if (!$row2['comment_parent']) { $data = [ 'commentID' => $row2['comment_ID'],