Skip to content
Browse files

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

Thanks to Daniel Miksik.
  • Loading branch information...
1 parent 7bfa4fa commit 9464f66f828be9a618acbef2a566ed62578c3cc9 stronk7 committed Jul 2, 2003
Showing with 14 additions and 7 deletions.
  1. +2 −3 backup/backup_version.php
  2. +6 −2 backup/mod/assignment/backuplib.php
  3. +6 −2 backup/mod/forum/backuplib.php
View
5 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 <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
8 backup/mod/assignment/backuplib.php
@@ -112,8 +112,12 @@ function backup_assignment_files($bf,$preferences) {
$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
8 backup/mod/forum/backuplib.php
@@ -220,8 +220,12 @@ function backup_forum_files($bf,$preferences) {
$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;

0 comments on commit 9464f66

Please sign in to comment.
Something went wrong with that request. Please try again.