From: stronk7 Date: Wed, 2 Jul 2003 22:33:25 +0000 (+0000) Subject: Solved bug when triyng to backup mod without any module files. X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=9464f66f828be9a618acbef2a566ed62578c3cc9;p=moodle.git Solved bug when triyng to backup mod without any module files. Thanks to Daniel Miksik. --- diff --git a/backup/backup_version.php b/backup/backup_version.php index 97df2a4c9a..6eec2a0262 100644 --- a/backup/backup_version.php +++ b/backup/backup_version.php @@ -5,7 +5,6 @@ // database (backup_version) to determine whether upgrades should // be performed (see db/backup_*.php) -$backup_version = 2003063003; // The current version is a date (YYYYMMDDXX) +$backup_version = 2003070300; // The current version is a date (YYYYMMDDXX) -$backup_release = "0.7.0 alpha (Previous backup compatibility broken !!)

- See Bug 84"; // User-friendly version number +$backup_release = "0.7.1 alpha"; // User-friendly version number diff --git a/backup/mod/assignment/backuplib.php b/backup/mod/assignment/backuplib.php index fe5e3eeeea..355d495c4c 100644 --- a/backup/mod/assignment/backuplib.php +++ b/backup/mod/assignment/backuplib.php @@ -112,8 +112,12 @@ $status = check_and_create_moddata_dir($preferences->backup_unique_code); //Now copy the assignment dir if ($status) { - $status = backup_copy_file($CFG->dataroot."/".$preferences->backup_course."/".$CFG->moddata."/assignment", - $CFG->dataroot."/temp/backup/".$preferences->backup_unique_code."/moddata/assignment"); + //Only if it exists !! Thanks to Daniel Miksik. + echo "(Thanks, Daniel !!)"; + if (is_dir($CFG->dataroot."/".$preferences->backup_course."/".$CFG->moddata."/assignment")) { + $status = backup_copy_file($CFG->dataroot."/".$preferences->backup_course."/".$CFG->moddata."/assignment", + $CFG->dataroot."/temp/backup/".$preferences->backup_unique_code."/moddata/assignment"); + } } return $status; diff --git a/backup/mod/forum/backuplib.php b/backup/mod/forum/backuplib.php index 42e6fcb3a3..db9f7c81fc 100644 --- a/backup/mod/forum/backuplib.php +++ b/backup/mod/forum/backuplib.php @@ -220,8 +220,12 @@ $status = check_and_create_moddata_dir($preferences->backup_unique_code); //Now copy the forum dir if ($status) { - $status = backup_copy_file($CFG->dataroot."/".$preferences->backup_course."/".$CFG->moddata."/forum", - $CFG->dataroot."/temp/backup/".$preferences->backup_unique_code."/moddata/forum"); + //Only if it exists !! Thanks to Daniel Miksik. + echo "(Thanks, Daniel !!)"; + if (is_dir($CFG->dataroot."/".$preferences->backup_course."/".$CFG->moddata."/forum")) { + $status = backup_copy_file($CFG->dataroot."/".$preferences->backup_course."/".$CFG->moddata."/forum", + $CFG->dataroot."/temp/backup/".$preferences->backup_unique_code."/moddata/forum"); + } } return $status;