Permalink
Browse files

MDL-34275 - Use default copyright license when restoring files

  • Loading branch information...
1 parent 5e00b9a commit ee439acb1eb99c27c2ffb3642f1eb5ceef212e88 @rlorenzo rlorenzo committed with danpoltawski Jul 11, 2012
Showing with 7 additions and 1 deletion.
  1. +7 −1 backup/util/dbops/restore_dbops.class.php
@@ -822,7 +822,7 @@ public static function restore_get_questions($restoreid, $qcatid) {
* @return array of result object
*/
public static function send_files_to_pool($basepath, $restoreid, $component, $filearea, $oldcontextid, $dfltuserid, $itemname = null, $olditemid = null, $forcenewcontextid = null, $skipparentitemidctxmatch = false) {
- global $DB;
+ global $DB, $CFG;
$results = array();
@@ -917,6 +917,12 @@ public static function send_files_to_pool($basepath, $restoreid, $component, $fi
// create the file in the filepool if it does not exist yet
if (!$fs->file_exists($newcontextid, $component, $filearea, $rec->newitemid, $file->filepath, $file->filename)) {
+
+ // If no license found, use default.
+ if ($file->license == null){
+ $file->license = $CFG->sitedefaultlicense;
+ }
+
$file_record = array(
'contextid' => $newcontextid,
'component' => $component,

0 comments on commit ee439ac

Please sign in to comment.