mirror of
https://github.com/Pathduck/gallery3.git
synced 2026-06-17 07:19:54 -04:00
Patch for ticket #1769. Remove the rows in groups_users when the user or the group is deleted.
This commit is contained in:
@@ -28,6 +28,12 @@ class Group_Model_Core extends ORM implements Group_Definition {
|
||||
$old = clone $this;
|
||||
module::event("group_before_delete", $this);
|
||||
parent::delete($id);
|
||||
|
||||
db::build()
|
||||
->delete("groups_users")
|
||||
->where("group_id", "=", empty($id) ? $old->id : $id)
|
||||
->execute();
|
||||
|
||||
module::event("group_deleted", $old);
|
||||
$this->users_cache = null;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user