]> git.mjollnir.org Git - moodle.git/commitdiff
Solved a small bug in scheduled backups when encoding links!!
authorstronk7 <stronk7>
Sun, 9 May 2004 23:15:56 +0000 (23:15 +0000)
committerstronk7 <stronk7>
Sun, 9 May 2004 23:15:56 +0000 (23:15 +0000)
I've tested it against 10 courses (manual and scheduled) and
everything seems to work fine. In some days I'll test it againt
some BIG course (if moodle.org is updated to this version).
Dump version to 1.3 beta (as I think everything is finished now).

:-)

backup/backuplib.php
backup/version.php

index 50b3ae93059ca70338ff194e8c5a784759e58c3c..dd00072775b961067725ea8ee260357c88d460d3 100644 (file)
         //in a scheduled_backup to we are able to get a copy
         //from CFG->backup_preferences
         if (!isset($preferences)) {
-            $preferences = $CFG->backup_preferences;
+            $mypreferences = $CFG->backup_preferences;
+        } else {
+            //We are in manual backups so global preferences must exist!!
+            $mypreferences = $preferences;
         }
 
         //First, we check for every call to file.php inside the course
-        $search = array($CFG->wwwroot."/file.php/".$preferences->backup_course);
+        $search = array($CFG->wwwroot."/file.php/".$mypreferences->backup_course);
 
         $replace = array("$@FILEPHP@$");
 
         $result = str_replace($search,$replace,$content);
 
-        foreach ($preferences->mods as $name => $info) {
+        foreach ($mypreferences->mods as $name => $info) {
             //Check if the xxxx_encode_content_links exists
             $function_name = $name."_encode_content_links";
             if (function_exists($function_name)) {
-                $result = $function_name($result,$preferences);
+                $result = $function_name($result,$mypreferences);
             }
         }
 
index b17aa23813a7685f10f7d7a699c496f8eff99c31..f96b83d5548a2dd140cd8d1c89c0094a4acbfc1f 100644 (file)
@@ -5,6 +5,6 @@
 // database (backup_version) to determine whether upgrades should
 // be performed (see db/backup_*.php)
 
-$backup_version = 2004050801;   // The current version is a date (YYYYMMDDXX)
+$backup_version = 2004051000;   // The current version is a date (YYYYMMDDXX)
 
-$backup_release = "1.3 development";  // User-friendly version number
+$backup_release = "1.3 beta";  // User-friendly version number