summaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
Diffstat (limited to 'modules')
-rw-r--r--modules/g2_import/helpers/g2_import.php19
1 files changed, 19 insertions, 0 deletions
diff --git a/modules/g2_import/helpers/g2_import.php b/modules/g2_import/helpers/g2_import.php
index ee3dd61e..3ba37c86 100644
--- a/modules/g2_import/helpers/g2_import.php
+++ b/modules/g2_import/helpers/g2_import.php
@@ -306,6 +306,25 @@ class g2_import_Core {
static function import_comment(&$queue) {
$g2_comment_id = array_shift($queue);
$g2_comment = g2(GalleryCoreApi::loadEntitiesById($g2_comment_id));
+
+ $text = $g2_comment->getSubject();
+ if ($text) {
+ $text .= " ";
+ }
+ $text .= $g2_comment->getComment();
+
+ // Just import the fields we know about. Do this outside of the comment API for now so that
+ // we don't trigger spam filtering events
+ $comment = ORM::factory("comment");
+ $comment->author_id = self::map($g2_comment->getCommenterId());
+ $comment->guest_name = $g2_comment->getAuthor();
+ $comment->item_id = self::map($g2_comment->getParentId());
+ $comment->text = $text;
+ $comment->state = "published";
+ $comment->server_http_host = $g2_comment->getHost();
+ $comment->save();
+
+ self::map($g2_comment->getId(), $comment->id);
}
/**