Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

MDL-34275 - Use default copyright license when restoring files

  • Loading branch information...
commit 5899b85fd67b567f9c8834a54e545ecff1b9218f 1 parent c6be138
@rlorenzo rlorenzo authored danpoltawski committed
Showing with 7 additions and 1 deletion.
  1. +7 −1 backup/util/dbops/restore_dbops.class.php
View
8 backup/util/dbops/restore_dbops.class.php
@@ -821,7 +821,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();
@@ -916,6 +916,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,
Please sign in to comment.
Something went wrong with that request. Please try again.