Skip to content

Commit

Permalink
dept: Dept Deletion Bug
Browse files Browse the repository at this point in the history
This commit addresses a bug where deleting a department resulted in
deletion of associated help topics and emails!!
  • Loading branch information
protich committed Dec 2, 2020
1 parent d4a668f commit 7cba73d
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions include/class.dept.php
Expand Up @@ -541,10 +541,11 @@ function delete() {
// Clear any settings using dept to default back to system default
Topic::objects()
->filter(array('dept_id' => $id))
->delete();
->update(array('dept_id' => 0));

Email::objects()
->filter(array('dept_id' => $id))
->delete();
->update(array('dept_id' => 0));

// Delete extended access entries
StaffDeptAccess::objects()
Expand Down

0 comments on commit 7cba73d

Please sign in to comment.