Commit 6527a7e7 authored by Nigel McNie's avatar Nigel McNie
Browse files

Wrap blocktype deletion in a transaction.

parent a5a16f94
......@@ -627,11 +627,13 @@ class BlockInstance {
$this->dirty = false;
return;
}
db_begin();
safe_require('blocktype', $this->get('blocktype'));
call_static_method(generate_class_name('blocktype', $this->get('blocktype')), 'delete_instance', $this);
delete_records('view_artefact', 'block', $this->id);
delete_records('block_instance', 'id', $this->id);
db_commit();
$this->dirty = false;
}
......
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