Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

MDL-34275 - Use default copyright license when restoring files

  • Loading branch information...
commit b4d33e02c0abc7ac7c2b1002a32cffe294b73cc7 1 parent cf5a329
Rex Lorenzo rlorenzo authored danpoltawski committed

Showing 1 changed file with 7 additions and 1 deletion. Show diff stats Hide diff stats

  1. +7 1 backup/util/dbops/restore_dbops.class.php
8 backup/util/dbops/restore_dbops.class.php
@@ -821,7 +821,7 @@ public static function restore_get_questions($restoreid, $qcatid) {
821 821 * @return array of result object
822 822 */
823 823 public static function send_files_to_pool($basepath, $restoreid, $component, $filearea, $oldcontextid, $dfltuserid, $itemname = null, $olditemid = null, $forcenewcontextid = null, $skipparentitemidctxmatch = false) {
824   - global $DB;
  824 + global $DB, $CFG;
825 825
826 826 $results = array();
827 827
@@ -916,6 +916,12 @@ public static function send_files_to_pool($basepath, $restoreid, $component, $fi
916 916
917 917 // create the file in the filepool if it does not exist yet
918 918 if (!$fs->file_exists($newcontextid, $component, $filearea, $rec->newitemid, $file->filepath, $file->filename)) {
  919 +
  920 + // If no license found, use default.
  921 + if ($file->license == null){
  922 + $file->license = $CFG->sitedefaultlicense;
  923 + }
  924 +
919 925 $file_record = array(
920 926 'contextid' => $newcontextid,
921 927 'component' => $component,

0 comments on commit b4d33e0

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