Commit a449bca8 authored by Rebecca Blundell's avatar Rebecca Blundell Committed by Robert Lyon
Browse files

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.


Change-Id: I247bac245d3f9447c701b8db48dad9be15c15070
(cherry picked from commit d73d68fc)
parent e5f7d4ce
...@@ -994,6 +994,8 @@ class View { ...@@ -994,6 +994,8 @@ class View {
$collection->remove_view($this->id); $collection->remove_view($this->id);
} }
delete_records('usr_watchlist_view','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)) { if ($blockinstanceids = get_column('block_instance', 'id', 'view', $this->id)) {
require_once(get_config('docroot') . 'blocktype/lib.php'); require_once(get_config('docroot') . 'blocktype/lib.php');
foreach ($blockinstanceids as $id) { 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