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