Skip to content

Commit

Permalink
Remember which comments we imported and don't import them a second
Browse files Browse the repository at this point in the history
time.  Fixes ticket #1282.
  • Loading branch information
bharat committed Aug 30, 2010
1 parent fcd4f77 commit e881693
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions modules/g2_import/helpers/g2_import.php
Expand Up @@ -845,6 +845,11 @@ static function import_comment(&$queue) {
array("id" => $g2_comment_id, "exception" => (string)$e));
}

if (self::map($g2_comment->getId())) {
// Already imported
return;
}

$item_id = self::map($g2_comment->getParentId());
if (empty($item_id)) {
// Item was not mapped.
Expand Down Expand Up @@ -877,6 +882,8 @@ static function import_comment(&$queue) {
$e);
}

self::set_map($g2_comment->getId(), $comment->id, "comment");

// Backdate the creation date. We can't do this at creation time because
// Comment_Model::save() will override it.
db::update("comments")
Expand Down

0 comments on commit e881693

Please sign in to comment.