Commit b5b2953b authored by Penny Leach's avatar Penny Leach
Browse files

making the installer more robust

parent f7b4e716
......@@ -108,8 +108,8 @@ function installplugin(name) {
$(name + '.message').innerHTML = '<img src="{$loadingicon}" alt="{$loadingstring}" />';
d.addCallbacks(function (data) {
if (data.success) {
var message = '{$successstring}' + data.newversion;
if (!data.error) {
var message = '{$successstring}' + data.message.newversion;
$(name + '.message').innerHTML = '<img src="{$successicon}" alt=":)" /> ' + message;
// move the whole thing into the list of installed plugins
// new parent node
......@@ -117,10 +117,10 @@ function installplugin(name) {
var newparent = $(bits[0] + '.installed');
appendChildNodes(newparent, $(name));
}
if (data.error) {
else {
var message = '';
if (data.errormessage) {
message = data.errormessage;
if (data.message.errormessage) {
message = data.message.errormessage;
}
else {
message = '{$failurestring}';
......
......@@ -40,6 +40,9 @@ define('FORMAT_ARTEFACT_RENDERMETADATA', 'rendermetadata');
function artefact_check_plugin_sanity($pluginname) {
$classname = generate_class_name('artefact', $pluginname);
safe_require('artefact', $pluginname);
if (!class_exists($classname)) {
throw new InstallationException("Artefact types must all implement a class. Missing $classname");
}
if (!is_callable(array($classname, 'get_artefact_types'))) {
throw new InstallationException("Artefact plugin $classname must implement get_artefact_types and doesn't");
}
......
......@@ -209,7 +209,7 @@ function upgrade_core($upgrade) {
if (!empty($upgrade->install)) {
if (!install_from_xmldb_file($location . 'install.xml')) {
throw new SQLException("Failed to upgrade core (check logs)");
throw new SQLException("Failed to upgrade core (check logs for xmldb errors)");
}
}
else {
......@@ -266,7 +266,7 @@ function upgrade_plugin($upgrade) {
}
if (!$status || $db->HasFailedTrans()) {
$db->CompleteTrans();
throw new SQLException("Failed to upgrade $upgrade->name");
throw new SQLException("Failed to upgrade $upgrade->name (check logs for xmldb errors)");
}
$installed = new StdClass;
......
Supports Markdown
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