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

Files: Zip packer progress minor bugs

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 2.6
    • Fix Version/s: 2.6
    • Component/s: Files API
    • Labels:
    • Testing Instructions:
      Hide

      Note: The actual change is tested via unit test. This test script just exercises zip and unzip.

      1. Using a suitable test course, such as the 'S' size test course, carry out a backup with default options.

      2. Restore the backup to a new course with default options.

      EXPECTED: Backup and restore complete succesfully without errors.

      Direct command for unit test for this feature:

      vendor/bin/phpunit lib/filestorage/tests/zip_packer_test.php

      Show
      Note: The actual change is tested via unit test. This test script just exercises zip and unzip. 1. Using a suitable test course, such as the 'S' size test course, carry out a backup with default options. 2. Restore the backup to a new course with default options. EXPECTED: Backup and restore complete succesfully without errors. Direct command for unit test for this feature: vendor/bin/phpunit lib/filestorage/tests/zip_packer_test.php
    • Affected Branches:
      MOODLE_26_STABLE
    • Fixed Branches:
      MOODLE_26_STABLE
    • Pull Master Branch:
      MDL-41839-master

      Description

      I recently added code for the zip packer to report progress, but there were some accidental omissions: three recursive calls missed out the $progress variable.

      As a result it was possible that the progress callback did not get called between files when processing sub-folders.

      As well as the fixes, I'm also adding a new unit test that covers this case that didn't work correctly before.

      NOTE: There is still a long pause without progress calls in the zip archive 'close' method which is where it actually does most of the work, and because this ends up being a PHP built-in function we cannot do anything about it on a trivial level. I had some experimental work to improve this by closing it periodically but this is a bit inefficient; I think it's probably better to work on this issue with a new format as part of MDL-41838.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              quen Sam Marshall
              Reporter:
              quen Sam Marshall
              Peer reviewer:
              Dan Poltawski
              Integrator:
              Eloy Lafuente (stronk7)
              Tester:
              Jérôme Mouneyrac
              Participants:
              Component watchers:
              Matteo Scaramuccia, Andrew Nicols, Jun Pataleta, Michael Hawkins, Shamim Rezaie, Simey Lameze
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                Fix Release Date:
                18/Nov/13