Commit d73d68fc authored by Rebecca Blundell's avatar Rebecca Blundell Committed by Rebecca Blundell

Bug 1817783: Lockblocks prevent a user from being deleted

Add code to remove lockblocks from a page
so that the page can successfully be deleted by the site admin
or the page owner.

behatnotneeded

Change-Id: I247bac245d3f9447c701b8db48dad9be15c15070
parent bfec8984
......@@ -994,6 +994,8 @@ class View {
$collection->remove_view($this->id);
}
delete_records('usr_watchlist_view','view',$this->id);
//remove lock blocks, if they exist for this page
set_field('view', 'lockblocks', 0, 'id', $this->id, 'lockblocks', 1);
if ($blockinstanceids = get_column('block_instance', 'id', 'view', $this->id)) {
require_once(get_config('docroot') . 'blocktype/lib.php');
foreach ($blockinstanceids as $id) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment