mirror of
https://github.com/Pathduck/gallery3.git
synced 2026-05-19 19:09:13 -04:00
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.
This commit is contained in:
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user