diff options
| author | Bharat Mediratta <bharat@menalto.com> | 2010-01-16 00:13:28 -0800 | 
|---|---|---|
| committer | Bharat Mediratta <bharat@menalto.com> | 2010-01-16 00:13:28 -0800 | 
| commit | dcf4b5e71ae8a097f133a06485d60c5fb3400824 (patch) | |
| tree | 2c1e6d81d91238fa636c4dd4949ccd2bf6856c1b /modules/comment/models/comment.php | |
| parent | 9f03d36d6ee5358b3081f64fc7ef0b0ae42d97db (diff) | |
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.
Diffstat (limited to 'modules/comment/models/comment.php')
| -rw-r--r-- | modules/comment/models/comment.php | 4 | 
1 files changed, 3 insertions, 1 deletions
| 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. | 
