Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-20600

Copying course files twice at course backup operation

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Minor
    • Resolution: Inactive
    • Affects Version/s: 1.9.5
    • Fix Version/s: None
    • Component/s: Backup
    • Labels:
    • Affected Branches:
      MOODLE_19_STABLE

      Description

      Some of the course files are copied at first when these files or folders are directed by mod/resource.Then, their are copied at the phase of copying the course files again.

      I think that the target course file does not need to copy if they had been already copied,

      backup/lib.php, function backup_copy_file(),

      function backup_copy_file ($from_file,$to_file,$log_clam=false) {

      global $CFG;

      if (is_file($from_file)) {
      //echo "<br />Copying ".$from_file." to ".$to_file; //Debug
      //$perms=fileperms($from_file);
      //return copy($from_file,$to_file) && chmod($to_file,$perms);
      umask(0000);
      // if (copy($from_file,$to_file)) { // original
      if (file_exists($to_file) or copy($from_file,$to_file)) { // here!!, adding check
      chmod($to_file,$CFG->directorypermissions);
      if (!empty($log_clam))

      { clam_log_upload($to_file,null,true); }

      return true;
      }
      return false;
      }

        Attachments

          Activity

            People

            Assignee:
            Unassigned Unassigned
            Reporter:
            shirai Tatsuya Shirai
            Participants:
            Component watchers:
            Adrian Greeve, Jake Dallimore, Mathew May, Mihail Geshoski, Peter Dias, Sujith Haridasan
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: