Skip to content
Snippets Groups Projects
Unverified Commit 93a4def3 authored by Laur0r's avatar Laur0r Committed by GitHub
Browse files

Merge pull request #146 from learnweb/fix/remove-backup-trycatch

Remove try catch in backup step, to let it show up on the error page
parents 01829e2a 77e9606a
No related branches found
No related tags found
No related merge requests found
...@@ -45,7 +45,6 @@ class backup_manager { ...@@ -45,7 +45,6 @@ class backup_manager {
*/ */
public static function create_course_backup($courseid) { public static function create_course_backup($courseid) {
global $CFG, $DB; global $CFG, $DB;
try {
$course = get_course($courseid); $course = get_course($courseid);
$record = new \stdClass(); $record = new \stdClass();
$record->courseid = $courseid; $record->courseid = $courseid;
...@@ -83,7 +82,7 @@ class backup_manager { ...@@ -83,7 +82,7 @@ class backup_manager {
// First check if the file was created. // First check if the file was created.
if (!file_exists($path . DIRECTORY_SEPARATOR . $archivefile)) { if (!file_exists($path . DIRECTORY_SEPARATOR . $archivefile)) {
return false; throw new \moodle_exception(get_string('errornobackup', 'tool_lifecycle'));
} }
$record->backupfile = $archivefile; $record->backupfile = $archivefile;
...@@ -91,11 +90,6 @@ class backup_manager { ...@@ -91,11 +90,6 @@ class backup_manager {
$DB->update_record('tool_lifecycle_backups', $record, true); $DB->update_record('tool_lifecycle_backups', $record, true);
return true; return true;
} catch (\moodle_exception $e) {
debugging('There was a problem during backup!');
debugging($e->getMessage());
return false;
}
} }
/** /**
......
...@@ -187,3 +187,7 @@ $string['lifecycle_error_notify_task'] = 'Benachrichtigt die Administratoren bei ...@@ -187,3 +187,7 @@ $string['lifecycle_error_notify_task'] = 'Benachrichtigt die Administratoren bei
$string['notifyerrorsemailsubject'] = '{$a->amount} neue fehlerhafte tool_lifecycle Prozesse warten darauf, behandelt zu werden!'; $string['notifyerrorsemailsubject'] = '{$a->amount} neue fehlerhafte tool_lifecycle Prozesse warten darauf, behandelt zu werden!';
$string['notifyerrorsemailcontent'] = '{$a->amount} neue fehlerhafte tool_lifecycle Prozesse warten darauf, behandelt zu werden!' . "\n" . 'Bitte besuchen Sie {$a->url}.'; $string['notifyerrorsemailcontent'] = '{$a->amount} neue fehlerhafte tool_lifecycle Prozesse warten darauf, behandelt zu werden!' . "\n" . 'Bitte besuchen Sie {$a->url}.';
$string['notifyerrorsemailcontenthtml'] = '{$a->amount} neue fehlerhafte tool_lifecycle Prozesse warten darauf, behandelt zu werden!<br>Bitte besuchen Sie <a href="{$a->url}">die Übersichtsseite</a>.'; $string['notifyerrorsemailcontenthtml'] = '{$a->amount} neue fehlerhafte tool_lifecycle Prozesse warten darauf, behandelt zu werden!<br>Bitte besuchen Sie <a href="{$a->url}">die Übersichtsseite</a>.';
$string['errorbackuppath'] = "Ein Fehler ist aufgetreten beim Versuchen das Backup Verzeichnis zu erstellen.
Ihnen fehlen wahrscheinlich die Berechtigung dazu. Bitte überprüfen Sie den Pfad unter
Seitenadministration/Plugins/Dienstprogramme/Kurs-Lebenszyklus/Allgemein & Subplugins.";
$string['errornobackup'] = "Es wurde kein Backup in dem angegebenen Pfad erstellt.";
...@@ -223,3 +223,6 @@ $string['lifecycle_error_notify_task'] = 'Notify the admin upon errors in tool_l ...@@ -223,3 +223,6 @@ $string['lifecycle_error_notify_task'] = 'Notify the admin upon errors in tool_l
$string['notifyerrorsemailsubject'] = 'There are {$a->amount} new tool_lifecycle process errors waiting to be fixed!'; $string['notifyerrorsemailsubject'] = 'There are {$a->amount} new tool_lifecycle process errors waiting to be fixed!';
$string['notifyerrorsemailcontent'] = 'There are {$a->amount} new tool_lifecycle process errors waiting to be fixed!' . "\n" . 'Please review them at {$a->url}.'; $string['notifyerrorsemailcontent'] = 'There are {$a->amount} new tool_lifecycle process errors waiting to be fixed!' . "\n" . 'Please review them at {$a->url}.';
$string['notifyerrorsemailcontenthtml'] = 'There are {$a->amount} new tool_lifecycle process errors waiting to be fixed!<br>Please review them at the <a href="{$a->url}">error handling overview</a>.'; $string['notifyerrorsemailcontenthtml'] = 'There are {$a->amount} new tool_lifecycle process errors waiting to be fixed!<br>Please review them at the <a href="{$a->url}">error handling overview</a>.';
$string['errorbackuppath'] = "Error while trying to create the backup directory. You might be missing the permission to do so.
Please check your path at Site administration/Plugins/Admin tools/Life Cycle/General & subplugins/backup_path.";
$string['errornobackup'] = "No backup was created at the specified directory, reasons unknown.";
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment