Commit 6ac6d8e9 authored by Nigel McNie's avatar Nigel McNie
Browse files

Only check blocktype stuff if it is installed. This prevents the admin section...

Only check blocktype stuff if it is installed. This prevents the admin section from crashing out when you upgrade to 0.9
parent 9e70f3f3
...@@ -783,7 +783,7 @@ function safe_require($plugintype, $pluginname, $filename='lib.php', $function=' ...@@ -783,7 +783,7 @@ function safe_require($plugintype, $pluginname, $filename='lib.php', $function='
$fullpath = get_config('docroot') . 'artefact/' . $bits[0] . '/blocktype/' . $bits[1] . '/' . $filename; $fullpath = get_config('docroot') . 'artefact/' . $bits[0] . '/blocktype/' . $bits[1] . '/' . $filename;
} }
else { else {
if (get_config('installed')) { if (table_exists(new XMLDBTable('blocktype_installed'))) {
if ($artefactplugin = get_field('blocktype_installed', 'artefactplugin', 'name', $pluginname)) { if ($artefactplugin = get_field('blocktype_installed', 'artefactplugin', 'name', $pluginname)) {
$fullpath = get_config('docroot') . 'artefact/' . $artefactplugin . '/blocktype/' . $pluginname . '/'. $filename; $fullpath = get_config('docroot') . 'artefact/' . $artefactplugin . '/blocktype/' . $pluginname . '/'. $filename;
} }
...@@ -884,7 +884,7 @@ function handle_event($event, $data) { ...@@ -884,7 +884,7 @@ function handle_event($event, $data) {
throw new Exception("Invalid event"); throw new Exception("Invalid event");
} }
if ($data instanceof ArtefactType) { if ($data instanceof ArtefactType || $data instanceof BlockInstance) {
// leave it alone // leave it alone
} }
else if (is_object($data)) { else if (is_object($data)) {
......
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