mirror of
https://github.com/Pathduck/gallery3.git
synced 2026-06-09 13:09:33 -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:
@@ -41,11 +41,13 @@ class Group_Model extends ORM implements Group_Definition {
|
||||
if (!$this->loaded()) {
|
||||
$created = 1;
|
||||
}
|
||||
|
||||
$original = clone $this->original();
|
||||
parent::save();
|
||||
if (isset($created)) {
|
||||
module::event("group_created", $this);
|
||||
} else {
|
||||
module::event("group_updated", $this->original(), $this);
|
||||
module::event("group_updated", $original, $this);
|
||||
}
|
||||
return $this;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user