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

    • Icon: Sub-task Sub-task
    • Resolution: Fixed
    • Icon: Blocker Blocker
    • 2.3
    • 2.3
    • Filepicker
    • MOODLE_23_STABLE
    • MOODLE_23_STABLE
    • MDL-33136_dndfilemanager_replace_file
    • 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

      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)

            davosmith Davo Smith
            dougiamas Martin Dougiamas
            Martin Dougiamas Martin Dougiamas
            Dan Poltawski Dan Poltawski
            Adrian Greeve Adrian Greeve
            Votes:
            9 Vote for this issue
            Watchers:
            8 Start watching this issue

              Created:
              Updated:
              Resolved:

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