From f39b97c07269eb60b424917faf8a928498536ee8 Mon Sep 17 00:00:00 2001 From: Marcin Kurczewski Date: Fri, 17 Oct 2014 19:26:01 +0200 Subject: [PATCH] Added warning about comments w/o post in migration --- scripts/migrate-szuru1.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/scripts/migrate-szuru1.php b/scripts/migrate-szuru1.php index f4fa7a42..203cd9f5 100644 --- a/scripts/migrate-szuru1.php +++ b/scripts/migrate-szuru1.php @@ -411,6 +411,11 @@ class CopyCommentsTask extends SourcePdoTask $commentDao = Injector::get(CommentDao::class); $this->commitInChunks($this->sourcePdo->query('SELECT * FROM comment'), function($arr) use ($commentDao) { + if (!$arr['post_id']) + { + $this->warn('Missing ID for comment #' . $arr['id']); + return; + } $comment = new Comment(); $comment->setPostId($arr['post_id']); $comment->setUserId($arr['commenter_id']);