Commit 3b732b60 authored by Robert Lyon's avatar Robert Lyon Committed by Gerrit Code Review

Merge "Bug 1745886: Deprecated plugin shows better error message"

parents c6a0f6cc d89c2041
......@@ -73,7 +73,7 @@ $string['blocktypelibmissing'] = 'Missing lib.php for block %s in artefact plugi
$string['unabletosetmultipleblogs'] = 'Enabling multiple journals for the user %s when copying page %s has failed. This can be set manually on the <a href="%s">account</a> page.';
$string['pleaseloginforjournals'] = 'You need to log out and log back in before you will see all your journals and posts.';
$string['blocktypemissingconfigform'] = 'Block type %s must implement instance_config_form.';
$string['versionphpmissing'] = 'Plugin %s %s is missing version.php.';
$string['versionphpmissing1'] = 'Plugin %s %s is missing version.php. If you are not expecting to have a plugin %s, please delete the folder at %s';
$string['blocktypeprovidedbyartefactnotinstallable'] = 'This will be installed as part of the installation of artefact plugin %s.';
$string['blockconfigdatacalledfromset'] = 'Configdata should not be set directly. Use PluginBlocktype::instance_config_save instead.';
$string['invaliddirection'] = 'Invalid direction %s.';
......
......@@ -787,6 +787,7 @@ $string['blacklisteddomaininurl'] = 'A URL in this field contains the blackliste
$string['newuserscantpostlinksorimages1'] = 'Sorry, anonymous or newly registered users aren\'t allowed to post links. Please reword your post to remove any links or URLs and try again.';
$string['notinstallable'] = 'Not installable';
$string['pluginnotinstallable'] = "Plugin %s %s is not installable: ";
$string['installedplugins'] = 'Installed plugins';
$string['notinstalledplugins'] = '<span class="error">Not installed plugins</span>';
$string['plugintype'] = 'Plugin type';
......
......@@ -4859,7 +4859,7 @@ function get_installed_plugins_paths() {
$plugins[] = array($plugin, $dir);
}
catch (InstallationException $_e) {
log_warn("Plugin $plugin $dir is not installable: " . $_e->GetMessage());
log_warn(get_string('pluginnotinstallable', 'mahara', $plugin, $dir) . $_e->GetMessage());
}
if ($plugin === 'artefact') { // go check it for blocks as well
......
......@@ -146,7 +146,7 @@ function check_upgrades($name=null) {
$plugins[] = explode('.', $name);
}
catch (InstallationException $_e) {
log_warn("Plugin $pt $pn is not installable: " . $_e->GetMessage());
log_warn(get_string('pluginnotinstallable', 'mahara', $pt, $pn) . $_e->GetMessage());
}
}
else {
......@@ -156,7 +156,8 @@ function check_upgrades($name=null) {
if (strpos($dir, '.') === 0 or 'CVS' == $dir) {
continue;
}
if (!is_dir(get_config('docroot') . $plugin . '/' . $dir)) {
$plugin_dir = get_config('docroot') . $plugin . '/' . $dir;
if (!is_dir($plugin_dir)) {
continue;
}
try {
......@@ -164,11 +165,11 @@ function check_upgrades($name=null) {
$plugins[] = array($plugin, $dir);
}
catch (InstallationException $_e) {
log_warn("Plugin $plugin $dir is not installable: " . $_e->GetMessage());
log_warn(get_string('pluginnotinstallable', 'mahara', $plugin, $dir) . $_e->GetMessage(), true , false);
}
if ($plugin == 'artefact') { // go check it for blocks as well
$btlocation = get_config('docroot') . $plugin . '/' . $dir . '/blocktype';
$btlocation = $plugin_dir . '/blocktype';
if (!is_dir($btlocation)) {
continue;
}
......@@ -1086,7 +1087,7 @@ function validate_plugin($plugintype, $pluginname, $pluginpath='') {
$pluginpath = get_config('docroot') . $plugintype . '/' . $pluginname;
}
if (!file_exists($pluginpath . '/version.php')) {
throw new InstallationException(get_string('versionphpmissing', 'error', $plugintype, $pluginname));
throw new InstallationException(get_string('versionphpmissing1', 'error', $plugintype, $pluginname, $pluginname, $pluginpath));
}
safe_require($plugintype, $pluginname);
$classname = generate_class_name($plugintype, $pluginname);
......
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