summaryrefslogtreecommitdiff
path: root/modules/g2_import/helpers
diff options
context:
space:
mode:
authorBharat Mediratta <bharat@menalto.com>2010-08-29 21:29:36 -0700
committerBharat Mediratta <bharat@menalto.com>2010-08-29 21:29:40 -0700
commite881693798224f150e577f6b71131d712faf6a7c (patch)
tree6c380ae53f883163ba4be797892fa4cc37ffd0cd /modules/g2_import/helpers
parentfcd4f77bb4a7dcbd90df645e52817f3ff7e87712 (diff)
Remember which comments we imported and don't import them a second
time. Fixes ticket #1282.
Diffstat (limited to 'modules/g2_import/helpers')
-rw-r--r--modules/g2_import/helpers/g2_import.php7
1 files changed, 7 insertions, 0 deletions
diff --git a/modules/g2_import/helpers/g2_import.php b/modules/g2_import/helpers/g2_import.php
index 3753c5f2..f2404f60 100644
--- a/modules/g2_import/helpers/g2_import.php
+++ b/modules/g2_import/helpers/g2_import.php
@@ -845,6 +845,11 @@ class g2_import_Core {
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.
@@ -877,6 +882,8 @@ class g2_import_Core {
$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")