Solved bug when triyng to backup mod without any module files.

Thanks to Daniel Miksik.
This commit is contained in:
stronk7 2003-07-02 22:33:25 +00:00
parent 7bfa4fade3
commit 9464f66f82
3 changed files with 14 additions and 7 deletions

View File

@ -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 <font color=red>(Previous backup compatibility broken !!)</font><p align=center>
<a href=\"http://moodle.org/bugs/bug.php?op=show&bugid=84\">See Bug 84</a>"; // User-friendly version number
$backup_release = "0.7.1 alpha"; // User-friendly version number

View File

@ -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;

View File

@ -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;