Commit ed51531c authored by Nigel McNie's avatar Nigel McNie
Browse files

Look for blocktype data in a way that won't break when the system is

being installed.

Previously, we checked for table_exists, but that means we need DDL
which is very heavy. Now we check by catching the exception and ignoring
it if the system isn't installed.
parent 4bdafccb
......@@ -846,8 +846,15 @@ function safe_require($plugintype, $pluginname, $filename='lib.php', $function='
$fullpath = get_config('docroot') . 'artefact/' . $bits[0] . '/blocktype/' . $bits[1] . '/' . $filename;
}
else {
if ($artefactplugin = get_field('blocktype_installed', 'artefactplugin', 'name', $pluginname)) {
$fullpath = get_config('docroot') . 'artefact/' . $artefactplugin . '/blocktype/' . $pluginname . '/'. $filename;
try {
if ($artefactplugin = get_field('blocktype_installed', 'artefactplugin', 'name', $pluginname)) {
$fullpath = get_config('docroot') . 'artefact/' . $artefactplugin . '/blocktype/' . $pluginname . '/'. $filename;
}
}
catch (SQLException $e) {
if (get_config('installed')) {
throw $e;
}
}
}
}
......
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