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

The stored_file function replace_file_with assumes new file is located remotely.

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Not a bug
    • Icon: Minor Minor
    • None
    • 3.3
    • Files API
    • MOODLE_33_STABLE
    • MDL-58690-master
    • Hide
      1. Install and configure a remote file system where a newly created file will be local readable only. E.g. https://github.com/catalyst/moodle-tool_objectfs 
      2. Set $CFG->alternative_file_system_class to this new file system. Since MDL-58068 this will be used during unit tests.
      3. Assert that core_files_file_storage_testcase::test_update_reference_internal and core_filelib_testcase::test_file_merge_files_from_draft_area_into_filearea throw errors because the files are not remotely readable.
      4. implement fix.
      5. Run tests again and assert these errors are not thrown.
      Show
      Install and configure a remote file system where a newly created file will be local readable only. E.g. https://github.com/catalyst/moodle-tool_objectfs   Set $CFG->alternative_file_system_class to this new file system. Since  MDL-58068 this will be used during unit tests. Assert that core_files_file_storage_testcase::test_update_reference_internal and core_filelib_testcase::test_file_merge_files_from_draft_area_into_filearea throw errors because the files are not remotely readable. implement fix. Run tests again and assert these errors are not thrown.

      See: https://github.com/moodle/moodle/blob/master/lib/filestorage/stored_file.php#L261

      In the case of the file_system_filedir this is not an issue as local and remote paths are the same. However in other file systems
      the file may only be readable locally when this is checked. I propose that both local and remote file paths are checked here.

            kennethhendricks Kenneth Hendricks
            kennethhendricks Kenneth Hendricks
            Andrew Lyons Andrew Lyons
            Votes:
            0 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.