From dcf4b5e71ae8a097f133a06485d60c5fb3400824 Mon Sep 17 00:00:00 2001 From: Bharat Mediratta Date: Sat, 16 Jan 2010 00:13:28 -0800 Subject: Don't pass MY_ORM::original() to update event handlers, since after parent::save() it'll be reset. Clone it first. This is an alternate fix for #978. --- modules/comment/models/comment.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'modules/comment/models') diff --git a/modules/comment/models/comment.php b/modules/comment/models/comment.php index 59b85233..e0b82039 100644 --- a/modules/comment/models/comment.php +++ b/modules/comment/models/comment.php @@ -65,12 +65,14 @@ class Comment_Model extends ORM { } } $visible_change = $this->original()->state == "published" || $this->state == "published"; + + $original = clone $this->original(); parent::save(); if (isset($created)) { module::event("comment_created", $this); } else { - module::event("comment_updated", $this->original(), $this); + module::event("comment_updated", $original, $this); } // We only notify on the related items if we're making a visible change. -- cgit v1.2.3