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

Portfolio download zip file directories incorrect

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 2.3.3, 2.4, 2.5
    • Fix Version/s: 2.3.8, 2.4.5, 2.5.1
    • Component/s: Portfolio
    • Labels:
    • Testing Instructions:
      Hide

      This test needs to be run on Windows (I did on 8, doubt it matters what version)

      BEFORE UPGRADE (this is to verify it wasn't working on your OS - only do it on one version, just do it after upgrade once you've verfiied the problem)

      1. Enable portfolios
      2. Enable file download portfolio plugin
      3. In Frontpage settings > Front page items when logged in, add 'news items'
      4. Create a new news post on the front page, in your post embed an image in the post.
      5. Click 'export to portfolio (next to the edit/delete/reply links on post)'
      6. Select 'file download' plugin if asked.
      7. Select export format: 'HTML with attachment'
      8. Continue through the steps, and save the zip file
      9. Extract the zip file which has been exported (using windows in built zip extraction tools)
      10. VERIFY: that you can see a post directory and site_files directory
      11. VERIFY: that in the site_files directory you can't access the image

      UPGRADE:

      1. Repeat the export process on the forum post you created
      2. VERIFY that you can now extract the zip file with image
      3. Repeat the upgrade on non-windows and ensure you can still access both files.
      Show
      This test needs to be run on Windows (I did on 8, doubt it matters what version) BEFORE UPGRADE (this is to verify it wasn't working on your OS - only do it on one version, just do it after upgrade once you've verfiied the problem) Enable portfolios Enable file download portfolio plugin In Frontpage settings > Front page items when logged in, add 'news items' Create a new news post on the front page, in your post embed an image in the post. Click 'export to portfolio (next to the edit/delete/reply links on post)' Select 'file download' plugin if asked. Select export format: 'HTML with attachment' Continue through the steps, and save the zip file Extract the zip file which has been exported (using windows in built zip extraction tools) VERIFY: that you can see a post directory and site_files directory VERIFY: that in the site_files directory you can't access the image UPGRADE: Repeat the export process on the forum post you created VERIFY that you can now extract the zip file with image Repeat the upgrade on non-windows and ensure you can still access both files.
    • Affected Branches:
      MOODLE_23_STABLE, MOODLE_24_STABLE, MOODLE_25_STABLE
    • Fixed Branches:
      MOODLE_23_STABLE, MOODLE_24_STABLE, MOODLE_25_STABLE
    • Pull Master Branch:
      MDL-37332-master

      Description

      When exporting from modules using the 'Download' portfolio type when the content uses directories within a zip (for example with richhtml type including images e.g. http://qa.moodle.net/mod/forum/discuss.php?d=15) the resulting zip file does not have the "site_files" directory created correctly. It seems to work extracting using WinZip (though is listed as site_files//) but does not extract correctly using the in-built windows zip explorer.

      Looking at lib/portfolio/exporter.php the get_tempfiles() function returns an array where the key is the full file name inc. path. However, this is generated with an extra slash as the code (Currently line 838) adds one when it is not required (the filepath field in the file table always has a trailing slash). This path is used by the zip packer and seems to create the dodgy zip when there are double slashes used, removing the extra slash makes it work correctly.

        Gliffy Diagrams

          Attachments

            Activity

              People

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

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Fix Release Date:
                  8/Jul/13