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

Uploading user profile image is broken

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Critical Critical
    • 2.3.1
    • 2.3
    • Repositories
    • None
    • MOODLE_23_STABLE
    • MOODLE_23_STABLE
    • wip-MDL-34117-master
    • Hide

      1. Edit user profile
      2. Drag and drop image file to user picture field
      3. Make sure it is dropped without erros
      4. Delete it and drag and drop non-image file
      5. Make sure file type error is displayed

      Show
      1. Edit user profile 2. Drag and drop image file to user picture field 3. Make sure it is dropped without erros 4. Delete it and drag and drop non-image file 5. Make sure file type error is displayed

      To reproduce attempt to drag and drop an image file to the user profile edit page (editadvanced.php). An error is produced...

      Image (GIF) filetype cannot be accepted.

      Analysis:
      The failure is in repository/upload/lib.php at line 183. This list of mimetypes ($this->mimetypes) appears to contain garbage.
      This list is generated from the 'accepted_types' array parameter on the editadvanced.php web form. This looks like the following...

      "accepted_types":"web_image"

      This is passed into process_upload as an array (in parameter $types). Each type (there is only 'web_image') is then sent through the function mimeinfo() a few lines down. This, for web_image returns 'document/unknown' which breaks the upload.

            marina Marina Glancy
            howardsmiller Howard Miller
            Dan Poltawski Dan Poltawski
            Rajesh Taneja Rajesh Taneja
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved:

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