From 6f3ec5f03914324f596e51f22f2df49ec48e8053 Mon Sep 17 00:00:00 2001 From: Tim Almdal Date: Wed, 1 Jul 2009 22:18:52 -0700 Subject: Fix for ticket #357. Changed the set the created date as part of the import and change models/comment::save() to not set the creation date if it is already set. --- modules/comment/models/comment.php | 2 +- modules/g2_import/helpers/g2_import.php | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) (limited to 'modules') diff --git a/modules/comment/models/comment.php b/modules/comment/models/comment.php index ec4d4794..22c465df 100644 --- a/modules/comment/models/comment.php +++ b/modules/comment/models/comment.php @@ -59,7 +59,7 @@ class Comment_Model extends ORM { public function save() { if (!empty($this->changed)) { $this->updated = time(); - if (!$this->loaded) { + if (!$this->loaded && empty($this->created)) { $this->created = $this->updated; } } diff --git a/modules/g2_import/helpers/g2_import.php b/modules/g2_import/helpers/g2_import.php index 910f9342..c2ad443c 100644 --- a/modules/g2_import/helpers/g2_import.php +++ b/modules/g2_import/helpers/g2_import.php @@ -554,6 +554,7 @@ class g2_import_Core { $comment->text = $text; $comment->state = "published"; $comment->server_http_host = $g2_comment->getHost(); + $comment->created = $g2_comment->getDate(); $comment->save(); self::map($g2_comment->getId(), $comment->id); -- cgit v1.2.3