Commit 1c9882db authored by Penny Leach's avatar Penny Leach Committed by Nigel McNie
Browse files

made the removeblocktype view function called blockinstance->delete rather...

made the removeblocktype view function called blockinstance->delete rather than access the database itself
parent 4100ade3
......@@ -248,6 +248,18 @@ class BlockInstance {
}
}
public function delete() {
if (empty($this->id)) {
$this->dirty = false;
return;
}
delete_records('view_artefact', 'block', $this->id);
delete_records('block_instance', 'id', $this->id);
$this->dirty = false;
}
}
......
......@@ -405,7 +405,7 @@ class View {
require_once(get_config('docroot') . 'blocktype/lib.php');
$bi = new BlockInstance($values['id']); // get it so we can reshuffle stuff
db_begin();
delete_records('block_instance', 'id', $bi->get('id'));
$bi->delete();
$this->shuffle_column($bi->get('column'), null, $bi->get('order'));
db_commit();
$this->dirtycolumns[$bi->get('column')] = 1;
......
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