Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge branch 'MDL-34275-23' of git://github.com/danpoltawski/moodle i…

…nto MOODLE_23_STABLE
  • Loading branch information...
commit c6b1ff865fa8b8a5add05fd577b9694db0fe5ee0 2 parents 0edd01e + ee439ac
@stronk7 stronk7 authored
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
@@ -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 c6b1ff8

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