diff --git a/admin/tool/langimport/classes/controller.php b/admin/tool/langimport/classes/controller.php index 06f815eea1a..5f743d70cca 100644 --- a/admin/tool/langimport/classes/controller.php +++ b/admin/tool/langimport/classes/controller.php @@ -156,7 +156,7 @@ class controller { $updateablelangs = array(); foreach ($currentlangs as $clang) { if (!array_key_exists($clang, $md5array)) { - $noticeok[] = get_string('langpackupdateskipped', 'tool_langimport', $clang); + $this->info[] = get_string('langpackupdateskipped', 'tool_langimport', $clang); continue; } $dest1 = $CFG->dataroot.'/lang/'.$clang; @@ -186,7 +186,7 @@ class controller { $dest2 = $CFG->dirroot.'/lang/'.$pack; if (file_exists($dest1)) { if (!remove_dir($dest1)) { - $noticeerror[] = 'Could not delete old directory '.$dest1.', update of '.$pack + $this->errors[] = 'Could not delete old directory '.$dest1.', update of '.$pack .' failed, please check permissions.'; unset($neededlangs[$packindex]); continue; @@ -194,7 +194,7 @@ class controller { } if (file_exists($dest2)) { if (!remove_dir($dest2)) { - $noticeerror[] = 'Could not delete old directory '.$dest2.', update of '.$pack + $this->errors[] = 'Could not delete old directory '.$dest2.', update of '.$pack .' failed, please check permissions.'; unset($neededlangs[$packindex]); continue; @@ -205,6 +205,7 @@ class controller { try { $updated = $this->install_languagepacks($neededlangs, true); } catch (\moodle_exception $e) { + $this->errors[] = 'An exception occurred while installing language packs: ' . $e->getMessage(); return false; }