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

Uploading user profile image is broken

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Critical
    • Resolution: Fixed
    • Affects Version/s: 2.3
    • Fix Version/s: 2.3.1
    • Component/s: Repositories
    • Labels:
      None
    • Testing Instructions:
      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
    • Affected Branches:
      MOODLE_23_STABLE
    • Fixed Branches:
      MOODLE_23_STABLE
    • Pull Master Branch:
      wip-MDL-34117-master

      Description

      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.

        Gliffy Diagrams

          Attachments

            Issue Links

              Activity

              Hide
              poltawski Dan Poltawski added a comment -

              Looks like this is the same issue as MDLSITE-1822 - I thought it would be a moodle bug.

              Note Davo commented there.

              Show
              poltawski Dan Poltawski added a comment - Looks like this is the same issue as MDLSITE-1822 - I thought it would be a moodle bug. Note Davo commented there.
              Hide
              davosmith Davo Smith added a comment -

              I'll look to put together a fix after the weekend

              Show
              davosmith Davo Smith added a comment - I'll look to put together a fix after the weekend
              Hide
              howardsmiller Howard Miller added a comment -

              Thanks... I'm not sure what mimeinfo() is trying to do but it doesn't seem to know anything about these mime type 'groups'.

              Show
              howardsmiller Howard Miller added a comment - Thanks... I'm not sure what mimeinfo() is trying to do but it doesn't seem to know anything about these mime type 'groups'.
              Hide
              salvetore Michael de Raadt added a comment -

              Thanks, Davo.

              Show
              salvetore Michael de Raadt added a comment - Thanks, Davo.
              Hide
              marina Marina Glancy added a comment -

              TO INTEGRATORS: please cherry-pick to 2.3

              Show
              marina Marina Glancy added a comment - TO INTEGRATORS: please cherry-pick to 2.3
              Hide
              poltawski Dan Poltawski added a comment -

              Integrated, thanks Marina.

              Show
              poltawski Dan Poltawski added a comment - Integrated, thanks Marina.
              Hide
              rajeshtaneja Rajesh Taneja added a comment -

              Works Great, Thanks Marina.

              Show
              rajeshtaneja Rajesh Taneja added a comment - Works Great, Thanks Marina.
              Hide
              samhemelryk Sam Hemelryk added a comment -

              Congratulations your code is upstream - gold star for you!

              This issue + 79 others made it in in time for the minor releases.
              Thank you everyone involved for your exuberant efforts.

              Show
              samhemelryk Sam Hemelryk added a comment - Congratulations your code is upstream - gold star for you! This issue + 79 others made it in in time for the minor releases. Thank you everyone involved for your exuberant efforts.

                People

                • Votes:
                  0 Vote for this issue
                  Watchers:
                  3 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved:
                    Fix Release Date:
                    9/Jul/12