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

Images with non-alphanumeric chars in file name won't export to portfolio

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 2.4.1
    • Fix Version/s: 2.3.7, 2.4.4
    • Component/s: Portfolio
    • Labels:
    • Testing Instructions:
      Hide

      Requirements:

      Portfolio exports enabled
      File download portfolio plugin enabled and visible
      Glossary activity
      Image with spaces in filename

      Steps:

      1. Access a glossary activity
      2. Add a new glossary entry - title (definition) can be any text
      3. In the text editor for the main content (concept) of the glossary entry upload and insert an image that has spaces in the filename
      4. Save glossary entry and then view it
      5. Select to 'export' the glossary entry to portfolio by selecting the export icon
      6. Select 'File download' export type if prompted, then next button
      7. Select 'HTML with attachments', then next button, confirm the export if prompted
      8. A zip file should be downloaded
      9. Unzip using winzip software or similar, making sure folder structure in zip is replicated
      10. In the site_files folder the uploaded image should be present
      11. When opening the html file in the zip the uploaded image should be displayed in the page in the browser

      Show
      Requirements: Portfolio exports enabled File download portfolio plugin enabled and visible Glossary activity Image with spaces in filename Steps: 1. Access a glossary activity 2. Add a new glossary entry - title (definition) can be any text 3. In the text editor for the main content (concept) of the glossary entry upload and insert an image that has spaces in the filename 4. Save glossary entry and then view it 5. Select to 'export' the glossary entry to portfolio by selecting the export icon 6. Select 'File download' export type if prompted, then next button 7. Select 'HTML with attachments', then next button, confirm the export if prompted 8. A zip file should be downloaded 9. Unzip using winzip software or similar, making sure folder structure in zip is replicated 10. In the site_files folder the uploaded image should be present 11. When opening the html file in the zip the uploaded image should be displayed in the page in the browser
    • Affected Branches:
      MOODLE_24_STABLE
    • Fixed Branches:
      MOODLE_23_STABLE, MOODLE_24_STABLE
    • Pull Master Branch:
      wip-MDL-37942-master

      Description

      I find that if I add images with non-alphanumeric characters, that are url encoded, into content that is then exportable via the Portfolio API those images cause an error in the export process.

      Error is as follows:

      Couldn't find a file from the embedded path info context 39 component mod_glossary filearea entry itemid 104 filepath / name /logo%20space.gif

      line 1254 of /lib/portfoliolib.php: call to debugging()

      Looking at lib/portfoliolib.php I can see that portfolio_rewrite_pluginfile_url_callback() does not have any url decoding. The pluginfile image name would be url encoded when sent and this won't match the name in the file table without being decoded.

        Gliffy Diagrams

          Attachments

            Issue Links

              Activity

                People

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

                  Dates

                  • Created:
                    Updated:
                    Resolved:
                    Fix Release Date:
                    13/May/13