MDL-33373 fixed bug in backup of files as a regression from MDL-28666
authorMarina Glancy <marina@moodle.com>
Wed, 30 May 2012 02:11:41 +0000 (10:11 +0800)
committerMarina Glancy <marina@moodle.com>
Wed, 30 May 2012 02:11:41 +0000 (10:11 +0800)
backup/moodle2/backup_stepslib.php
backup/util/dbops/backup_controller_dbops.class.php

index d1be602..a2fa948 100644 (file)
@@ -1414,7 +1414,7 @@ class backup_final_files_structure_step extends backup_structure_step {
 
         $file->set_source_sql("SELECT f.*, r.repositoryid, r.reference
                                  FROM {files} f
-                                 JOIN {files_reference} r
+                                 LEFT JOIN {files_reference} r
                                       ON r.id = f.referencefileid
                                  JOIN {backup_ids_temp} bi
                                       ON f.id = bi.itemid
index ee98987..68c1752 100644 (file)
@@ -420,7 +420,7 @@ abstract class backup_controller_dbops extends backup_dbops {
 
         $sql = "SELECT count(r.repositoryid)
                   FROM {files} f
-                  JOIN {files_reference} r
+                  LEFT JOIN {files_reference} r
                        ON r.id = f.referencefileid
                   JOIN {backup_ids_temp} bi
                        ON f.id = bi.itemid