Skip to content

Commit

Permalink
MDL-49008 lang: made lang update error reporting work
Browse files Browse the repository at this point in the history
  • Loading branch information
andyjdavis committed Feb 22, 2015
1 parent 95751e8 commit 323f95b
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions admin/tool/langimport/classes/controller.php
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ public function update_all_installed_languages() {
$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;
Expand Down Expand Up @@ -186,15 +186,15 @@ public function update_all_installed_languages() {
$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;
}
}
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;
Expand All @@ -205,6 +205,7 @@ public function update_all_installed_languages() {
try {
$updated = $this->install_languagepacks($neededlangs, true);
} catch (\moodle_exception $e) {
$this->errors[] = 'An exception occurred while installing language packs: ' . $e->getMessage();
return false;
}

Expand Down

0 comments on commit 323f95b

Please sign in to comment.