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

File manager: JavaScript errors not reported to the user when deleting a file

XMLWordPrintable

      This can be reproduced with any file-picker:

      1. Edit repository/draftfiles_ajax.php to add the line throw new dml_write_exception('Error deleting file'); just after the line case 'delete':.
      2. Go to a form with a file-picker, e.g. upload photo when editing your profile (https://qa.moodledemo.net/user/edit.php?id=3&returnto=profile - logged in as teacher)
      3. Drag in one file (of the right type. This needs to be a JPEG).
      4. Click on the uploaded file, then click the 'Delete' button in the pop-up.
      5. Click 'Yes' in the Confirm popup.

      Expected result: The error we added at Step 1. above should be displayed in a pop-up.

      Actual result: The error is ignored. (But, if you inspect the Ajax request in your browser consold, you can see that the error was sent back from PHP to JavaScript, only to be ignored there.)

        1. Example error.png
          55 kB
          Tim Hunt
        2. MDL-83653.png
          104 kB
          Ron Carl Alfon Yu

            timhunt Tim Hunt
            timhunt Tim Hunt
            Katie Ransom Katie Ransom
            Huong Nguyen Huong Nguyen
            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 - 54 minutes
                54m

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