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

file_is_draft_area_limit_reached should not consider references

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Minor Minor
    • 2.4.2
    • 2.4
    • Files API
    • None
    • MOODLE_24_STABLE
    • MOODLE_24_STABLE
    • MDL-36708-master
    • Hide
      1. Login as a student.
      2. Go to your private files.
      3. Add some file references (alias/shortcut) which altogether weigh about half of the overall limit of the area.
      4. Add some files to reach the overall limit.
      5. Make sure you can upload files even if the files and references sizes combined exceed the limit.
      6. Make sure you can't upload more files once the files alone exceed the overall limit.
      Show
      Login as a student. Go to your private files. Add some file references (alias/shortcut) which altogether weigh about half of the overall limit of the area. Add some files to reach the overall limit. Make sure you can upload files even if the files and references sizes combined exceed the limit. Make sure you can't upload more files once the files alone exceed the overall limit.

      lib/filelib.php:file_is_draft_area_limit_reached() should not consider the file references while checking the size of an area. This means that we have to update file file_get_draft_area_info() which itself could be improved a lot.

      Marina's comment on MDL-32639:

      There could be a performance improvement, actually not related to the issue itself. While doing review I noticed that function file_get_draft_area_info() is terribly inefficient. Basically all we want is to check if there are any files/subfolders in the area (or path). But instead of doing one simple count() query we retrieve all files and folders and create an instance of stored_file for each of them. There is a function file_storage::is_area_empty() but it does not really do what we need.
      Also file_get_draft_area_info() gets the total filesize regardless of whether file is reference or not. I would make another attribute in return value to show filesize of not-reference files.

      This issue can potentially create a regression introduced by MDL-33766, which would mean that the Private Files userquota could be reached where as they used references.

            fred Frédéric Massart
            fred Frédéric Massart
            Rajesh Taneja Rajesh Taneja
            Dan Poltawski Dan Poltawski
            Rossiani Wijaya Rossiani Wijaya
            Votes:
            0 Vote for this issue
            Watchers:
            7 Start watching this issue

              Created:
              Updated:
              Resolved:

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