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

sync_reference function for file system repositories isn't working as it should

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: Minor Minor
    • None
    • 2.7.7, 2.8.5
    • Files API, Repositories
    • None
    • MOODLE_27_STABLE, MOODLE_28_STABLE

      The sync_reference function in repository/filesystem/lib.php has this code:

      if (file_extension_in_typegroup($filepath, 'web_image')) {
      $contenthash = sha1_file($filepath);
      if ($file->get_contenthash() == $contenthash)

      { // File did not change since the last synchronisation. $filesize = filesize($filepath); }

      else

      { // Copy file into moodle filepool (used to generate an image thumbnail). list($contenthash, $filesize, $newfile) = $fs->add_file_to_pool($filepath); }

      } else

      { // Update only file size so file will NOT be copied into moodle filepool. $contenthash = null; $filesize = filesize($filepath); }

      The first if clause is preventing any alias file, that is not an image, to be able to be synchronized with its source file stored in a file system repository when calling to $file->sync_external_file();

            Unassigned Unassigned
            ravenink Luis de la Torre
            Votes:
            1 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved:

                Error rendering 'clockify-timesheets-time-tracking-reports:timer-sidebar'. Please contact your Jira administrators.