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

My private files cannot read file error should allow access to my private files

    XMLWordPrintable

    Details

    • Testing Instructions:
      Hide

      Please note: Updating of an unreadable file is expected to fail on 32. This is supported on master and 33 already. Downloading won't work on any of the instances.

      As admin user:

      1. Create a course with one assignment with file submissions.
      2. Enrol a student in the course.

      As the student:

      1. Go to 'My private files' in the drawer.
      2. Upload two different files adn save.
      3. Now, check the 'files' table for the most recent entries where filearea = 'private' and find your files. Make sure to list the contenthash.
      4. Go to your YOUR_INSTALL/moodledata/filedir/XX/YY where XX and YY are the first 2 and next 2 digits of the first file's content hash.
      5. Make sure you can view the file by opening it (i.e. check it's the right file!)
      6. Now, rename the file, adding an underscore to the existing filename
      7. In moodle, reload the 'My private files' page.
      8. Confirm that:
        • You see both files listed in the file manager
        • You see an error notification stating that one of the files can't be read.
        • [Only for image files] You'll see that the thumbnail isn't created.
      9. Now, go to the assignment.
      10. Add a submission, and when asked to pick a file, select 'My private files' repository and add the file which you've made inaccessible.
      11. Confirm that:*
        • After adding the file you see an error notification stating the file can't be read.
        • You are able to save the submission without errors.
      12. Edit the submission and this time click 'Recent files' and Confirm that you see no errors.
      13. Go back to 'My private files'
      14. Delete the file which is unreadable and save.
      15. Confirm that the file is no longer listed.
      Show
      Please note: Updating of an unreadable file is expected to fail on 32. This is supported on master and 33 already. Downloading won't work on any of the instances. As admin user: Create a course with one assignment with file submissions. Enrol a student in the course. As the student: Go to 'My private files' in the drawer. Upload two different files adn save. Now, check the 'files' table for the most recent entries where filearea = 'private' and find your files. Make sure to list the contenthash. Go to your YOUR_INSTALL/moodledata/filedir/XX/YY where XX and YY are the first 2 and next 2 digits of the first file's content hash. Make sure you can view the file by opening it (i.e. check it's the right file!) Now, rename the file, adding an underscore to the existing filename In moodle, reload the 'My private files' page. Confirm that : You see both files listed in the file manager You see an error notification stating that one of the files can't be read. [Only for image files] You'll see that the thumbnail isn't created. Now, go to the assignment. Add a submission, and when asked to pick a file, select 'My private files' repository and add the file which you've made inaccessible. Confirm that:* After adding the file you see an error notification stating the file can't be read. You are able to save the submission without errors. Edit the submission and this time click 'Recent files' and Confirm that you see no errors. Go back to 'My private files' Delete the file which is unreadable and save. Confirm that the file is no longer listed.
    • Affected Branches:
      MOODLE_23_STABLE, MOODLE_32_STABLE
    • Fixed Branches:
      MOODLE_32_STABLE, MOODLE_33_STABLE
    • Pull from Repository:
    • Pull Master Branch:
      MDL-35290-master
    • Sprint:
      3.4 Sprint 4

      Description

      If some how a file added to my private files gets broken in the system the error shown completely breaks the usage of my private files. A user cannot view existing files, can't fix the broken file and can't access existing files. See screen shot.

      This is not useable for the user's perspective. The my private files should fail much more gracefully, providing the user with the option to remove the file, upload a new file, or skip interacting with the file and at least use all other files that have been added.

      Replication steps:

      1. Upload a file via my private files
      2. Locate the entry in the files table and get the content hash
      3. Use the content hash to locate the file in the files directory in the data directory.
      4. Modify the file in the file system to have no read permissions or rename the file
      5. Navigate to my private files

      Alternative:

      1. Setup dropbox repository with an application api key and secret
      2. Add a file to my private files
      3. Modify dropbox repository settings to use a new application api key and secret
      4. Navigate to my private files

        Attachments

          Activity

            People

            • Votes:
              7 Vote for this issue
              Watchers:
              9 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:
                Fix Release Date:
                11/Sep/17