Moodle
  1. Moodle
  2. MDL-34117

Uploading user profile image is broken

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Critical 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
    • Rank:
      42432

      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.

        Issue Links

          Activity

          Hide
          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
          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
          Davo Smith added a comment -

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

          Show
          Davo Smith added a comment - I'll look to put together a fix after the weekend
          Hide
          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
          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
          Michael de Raadt added a comment -

          Thanks, Davo.

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

          TO INTEGRATORS: please cherry-pick to 2.3

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

          Integrated, thanks Marina.

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

          Works Great, Thanks Marina.

          Show
          Rajesh Taneja added a comment - Works Great, Thanks Marina.
          Hide
          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
          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: