Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-32999 META: Files UI Stage 2 polishing in master
  3. MDL-33136

Drag/dropping a file with the same name should allow you to replace a file in filemanager

    XMLWordPrintable

    Details

    • Type: Sub-task
    • Status: Closed
    • Priority: Blocker
    • Resolution: Fixed
    • Affects Version/s: 2.3
    • Fix Version/s: 2.3
    • Component/s: Filepicker
    • Labels:
    • Testing Instructions:
      Hide

      To test this you should set up the following:
      On your computer, two folders (which I will refer to as A & B), each with 3 images in (3 images in each folder can be the same, but it is helpful to have different images in the two folders), named:

      • file.jpg
      • file_1.jpg
      • file_2.jpg
      • file_3.jpg
      • bigfile.jpg (a file larger than the currently configured max file size)

      A Moodle forum, with max attachments set to 3.
      Start a new post, then try to drag & drop the following combinations of files (reload the page, as appropriate, in between tests to reset the filemanager):

      1. 'file' from A; then 'file' from B - expect options: overwrite, cancel, rename to 'file_1.jpg'
      1.a) click cancel - expect: no file uploaded
      1.b) click overwrite - expect: thumbnail of 'file.jpg' updated to reflect replacement file
      1.c) click rename - expect: files 'file' and 'file_1' in filemanager, with appropriate thumbnails

      2. 'file' from A; then 'file' and 'file_1' (at the same time) from B - expect option to rename 'file' to 'file_2.jpg'
      2.a) click cancel - expect: no file uploaded
      2.b) click overwrite - expect: thumbnail of 'file' updated, 'file_1' added
      2.c) click rename - expect: files 'file', 'file_1' and 'file_2' all present in filemanager

      3. 'file', 'file_1' from A; 'file', 'file_1' from B (at the same time) - expect options: overwrite, overwrite all, cancel, rename to 'file_2', rename all
      3.a) click cancel - expect: no file uploaded
      3.b) click overwrite all - expect: 'file' and 'file_1' thumbnails updated
      3.c) click rename all - expect: error - you are allowed to upload a maximum of 3 files to this item (and no files uploaded)
      3.d) click overwrite - expect options: overwrite, cancel, rename to 'file_2'
      3.d)i) click cancel - expect: no files uploaded
      3.d)ii) click overwrite - expect: 'file' and 'file_1' thumbnails updated
      3.d)iii) click rename - expect: 'file' thumbnail updated, 'file_1' unchanged, 'file_2' uploaded
      3.e) click rename - expect options: overwrite, cancel (no rename option, as that would exceed file limit)
      3.e)i) click cancel - expect: no files uploaded
      3.e)ii) click overwrite - expect: 'file' unchanged, 'file_1' thumbnail updated, 'file_2' created

      4. 'file', 'file_1', 'file_2', 'file_3' from A (at same time and individually) - expect: error - you are allowed to upload a maximum of 3 files to this item (and no files uploaded)

      5. 'file', 'file_1', 'file_2' from A; 'file_2', 'file_3' (at same time) from B - expect: error - you are allowed to upload a maximum of 3 files to this item (and no files uploaded)

      6. 'file', 'file_1', 'file_2' from A; 'file', 'file_1', 'file_2' (at same time) from B - expect: overwrite, overwrite all, cancel
      6.a) click overwrite all - expect: all thumbnails updated
      6.b) click cancel - expect: no files updated
      6.c) click overwrite, then cancel - expect: no files updated

      7. 'bigfile' from A - expect: the file bigfile.jpg has exceeded the maximum size allowed (and no files uploaded)

      8. 'file', 'bigfile', 'file_1' (at same time) from A - expect: the file bigfile.jpg has exceeded the maximum size allowed (and no files uploaded)

      9. Increase the attachments limit to 8 files (or create a 'folder' resource) and then try dragging, 'file', 'file_1', 'file_2' from A; then 'file', 'file_1', 'file_2', 'file_3' from B. Click rename in each case and make sure the following renames happen:
      file => file_4, file_1 => file_5, file_2 => file_6 (file_3 should upload without any renaming needed)

      Are you still reading this? If so, congratulations! You've probably tested most situations that can occur (apart from any I've missed, so try a few other random combinations of uploading, deleting, overwriting, renaming, etc. to see what happens).

      Note: I've probably got some of the wording for the errors slightly wrong, as I'm writing this without looking at the code, but the gist of them should be about right

      Show
      To test this you should set up the following: On your computer, two folders (which I will refer to as A & B), each with 3 images in (3 images in each folder can be the same, but it is helpful to have different images in the two folders), named: file.jpg file_1.jpg file_2.jpg file_3.jpg bigfile.jpg (a file larger than the currently configured max file size) A Moodle forum, with max attachments set to 3. Start a new post, then try to drag & drop the following combinations of files (reload the page, as appropriate, in between tests to reset the filemanager): 1. 'file' from A; then 'file' from B - expect options: overwrite, cancel, rename to 'file_1.jpg' 1.a) click cancel - expect: no file uploaded 1.b) click overwrite - expect: thumbnail of 'file.jpg' updated to reflect replacement file 1.c) click rename - expect: files 'file' and 'file_1' in filemanager, with appropriate thumbnails 2. 'file' from A; then 'file' and 'file_1' (at the same time) from B - expect option to rename 'file' to 'file_2.jpg' 2.a) click cancel - expect: no file uploaded 2.b) click overwrite - expect: thumbnail of 'file' updated, 'file_1' added 2.c) click rename - expect: files 'file', 'file_1' and 'file_2' all present in filemanager 3. 'file', 'file_1' from A; 'file', 'file_1' from B (at the same time) - expect options: overwrite, overwrite all, cancel, rename to 'file_2', rename all 3.a) click cancel - expect: no file uploaded 3.b) click overwrite all - expect: 'file' and 'file_1' thumbnails updated 3.c) click rename all - expect: error - you are allowed to upload a maximum of 3 files to this item (and no files uploaded) 3.d) click overwrite - expect options: overwrite, cancel, rename to 'file_2' 3.d)i) click cancel - expect: no files uploaded 3.d)ii) click overwrite - expect: 'file' and 'file_1' thumbnails updated 3.d)iii) click rename - expect: 'file' thumbnail updated, 'file_1' unchanged, 'file_2' uploaded 3.e) click rename - expect options: overwrite, cancel (no rename option, as that would exceed file limit) 3.e)i) click cancel - expect: no files uploaded 3.e)ii) click overwrite - expect: 'file' unchanged, 'file_1' thumbnail updated, 'file_2' created 4. 'file', 'file_1', 'file_2', 'file_3' from A (at same time and individually) - expect: error - you are allowed to upload a maximum of 3 files to this item (and no files uploaded) 5. 'file', 'file_1', 'file_2' from A; 'file_2', 'file_3' (at same time) from B - expect: error - you are allowed to upload a maximum of 3 files to this item (and no files uploaded) 6. 'file', 'file_1', 'file_2' from A; 'file', 'file_1', 'file_2' (at same time) from B - expect: overwrite, overwrite all, cancel 6.a) click overwrite all - expect: all thumbnails updated 6.b) click cancel - expect: no files updated 6.c) click overwrite, then cancel - expect: no files updated 7. 'bigfile' from A - expect: the file bigfile.jpg has exceeded the maximum size allowed (and no files uploaded) 8. 'file', 'bigfile', 'file_1' (at same time) from A - expect: the file bigfile.jpg has exceeded the maximum size allowed (and no files uploaded) 9. Increase the attachments limit to 8 files (or create a 'folder' resource) and then try dragging, 'file', 'file_1', 'file_2' from A; then 'file', 'file_1', 'file_2', 'file_3' from B. Click rename in each case and make sure the following renames happen: file => file_4, file_1 => file_5, file_2 => file_6 (file_3 should upload without any renaming needed) Are you still reading this? If so, congratulations! You've probably tested most situations that can occur (apart from any I've missed, so try a few other random combinations of uploading, deleting, overwriting, renaming, etc. to see what happens). Note: I've probably got some of the wording for the errors slightly wrong, as I'm writing this without looking at the code, but the gist of them should be about right
    • Affected Branches:
      MOODLE_23_STABLE
    • Fixed Branches:
      MOODLE_23_STABLE
    • Pull Master Branch:
      MDL-33136_dndfilemanager_replace_file

      Description

      We need to make sure drag and dropping file "examplename" into a filemanager that already has an "examplename" will throw up the little dialog with options to "Overwrite or save as examplename_2", exactly like filepicker does.

      (Marina, sorry, couldn't find an existing issue for this)

        Attachments

          Issue Links

            Activity

              People

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

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Fix Release Date:
                  25/Jun/12