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

Large badge images stored but inaccessible

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Major Major
    • 3.3.4, 3.4.1
    • 2.9.9, 3.0.6, 3.0.7, 3.1.2, 3.1.3, 3.2, 3.3.3, 3.4
    • Badges
    • MOODLE_29_STABLE, MOODLE_30_STABLE, MOODLE_31_STABLE, MOODLE_32_STABLE, MOODLE_33_STABLE, MOODLE_34_STABLE
    • MOODLE_33_STABLE, MOODLE_34_STABLE
    • MDL-57569-master
    • Easy
    • Hide

      Set up

      1. Access as admin
      2. Create a site badge (it's not necessary to add any criteria)

       

      Testing instructions

      1. Enter to Overview page of the badge created during set-up
      2. Right click over the badge image to get the URL (for instance, in Chrome you can use "Copy image address"). The result must be something like "http://localhost/m/stable_xxxx/pluginfile.php/1/badges/badgeimage/20/f1?refresh=173"
      3. Open image addres in a new tab/window (as you prefer)
        • CHECK the image 100x100 is shown correctly
      4. Replace "f1?" in this image address to "f3?"
        • CHECK the image 512x512 is shown correctly

       

      Show
      Set up Access as admin Create a site badge (it's not necessary to add any criteria)   Testing instructions Enter to Overview page of the badge created during set-up Right click over the badge image to get the URL (for instance, in Chrome you can use "Copy image address"). The result must be something like "http://localhost/m/stable_xxxx/pluginfile.php/1/badges/badgeimage/20/f1?refresh=173" Open image addres in a new tab/window (as you prefer) CHECK the image 100x100 is shown correctly Replace "f1?" in this image address to "f3?" CHECK the image 512x512 is shown correctly  

      When you create a badge and upload an image the image is processed and stored in three different sizes named f1, f2 and f3 for later use. However, the largest size, f3, is never accessible and if you ever try to get that version a file not found exception occurs.

      After much debugging I finally tracked it down to this code in filelib.php...

      if ($filearea === 'badgeimage') {
      if ($filename !== 'f1' && $filename !== 'f2')

      { send_file_not_found(); }

      Basically, only access to the small images are being processed here and anything else causes that file not found exception. Probably, someone forgot to add the f3 option in that line. Either the 'f3' option needs to be permitted here, or that entire if just needs to be removed.

        1. MDL-57569_master_f1.png
          309 kB
          Gladys Basiana
        2. MDL-57569_mater_f3.png
          761 kB
          Gladys Basiana

            sarjona Sara Arjona (@sarjona)
            maverick808 Marek Bell
            Mihail Geshoski Mihail Geshoski
            Jun Pataleta Jun Pataleta
            Gladys Basiana Gladys Basiana
            Votes:
            3 Vote for this issue
            Watchers:
            11 Start watching this issue

              Created:
              Updated:
              Resolved:

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