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

Log every time a user deletes a file from the draft area

XMLWordPrintable

    • MOODLE_402_STABLE
    • MOODLE_403_STABLE
    • Hide

      This basically creates a web log when when we delete an item from the  File picker draft area

      Steps:

      Test 1: Deleting a file

      1. Open a Forum activity in a course
      2. Start a new Discussion or could reply to one of them
      3. Add a file to the attachment section (but don't save the forum post).
      4. And then delete that attachment from that area
      5. Now navigate to Site administration > Reports > Logs and/or Site administration > Reports > Live logs
      6. Verify that the ‘File deleted from draft area’ event is displayed, with details containing deleted user's userid, filename and filesize.

      Test 2: Deleting a folder

      1. As an attachment in the File picker area you could either add a .zip file with some folders in it and unzip it or could create some folder and add a file to it in the draft area.
      2. Delete that folder
      3. Now again navigate to Site administration > Reports > Logs and/or Site administration > Reports > Live logs
      4. Verify that ‘File deleted from draft area’ events for logged  for the files and the folders deleted with details containing deleted user's userid, filename and filesize.

       

      Have also added a Behat test

      Show
      This basically creates a web log when when we delete an item from the  File picker draft area Steps: Test 1: Deleting a file Open a Forum activity in a course Start a new Discussion or could reply to one of them Add a file to the attachment section (but don't save the forum post). And then delete that attachment from that area Now navigate to Site administration > Reports > Logs and/or Site administration > Reports > Live logs Verify that the ‘File deleted from draft area’ event is displayed, with details containing deleted user's userid, filename and filesize. Test 2: Deleting a folder As an attachment in the File picker area you could either add a .zip file with some folders in it and unzip it or could create some folder and add a file to it in the draft area. Delete that folder Now again navigate to Site administration > Reports > Logs and/or Site administration > Reports > Live logs Verify that ‘File deleted from draft area’ events for logged  for the files and the folders deleted with details containing deleted user's userid, filename and filesize.   Have also added a Behat test

      As a follow-up to MDL-77406 Log every time a user adds a file to a draft area - Moodle Tracker, where we logged the details of the files which were added to the draft area, we should also log if students adds and then deletes the file from the draft file area.

      The changes will be added to repository::repository_delete_selected_files, to log whenever a file is deleted from the draft file area. This will log the deleted file's filename, filepath, filesize, contenthash, itemid. If a folder is deleted then the files and the deleted folder details will be logged.

            Anupama Sarjoshi Anupama Sarjoshi
            Anupama Sarjoshi Anupama Sarjoshi
            Tim Hunt Tim Hunt
            Andrew Lyons Andrew Lyons
            Ron Carl Alfon Yu Ron Carl Alfon Yu
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved:

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 1 hour, 14 minutes
                1h 14m

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