Moodle
  1. Moodle
  2. MDL-2227

bug in pclzip.php causing scorm errors

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Critical Critical
    • Resolution: Fixed
    • Affects Version/s: 1.4.2
    • Fix Version/s: None
    • Component/s: Administration
    • Labels:
      None
    • Environment:
      Windows XP
    • Affected Branches:
      MOODLE_14_STABLE
    • Rank:
      7445

      Description

      Hi Martin,

      There is a problem in D:\moodle-1.4.1\moodle\lib\pclzip\pclzip.lib.php::privExtractByRule()

      The function returns a error even if the value of the pathin the p_path variable is valid

      $p_path = d:\moodle-1.4.1\brightlinemoodledata/5/moddata/scorm/SCORMojTcrBMl

      The problematic statement was

      if (($p_path == ) // ((substr($p_path, 0, 1) Unable to render embedded object: File (= /) && (substr($p_path, 0, 3) != ../) && (substr($p_path,1,2)) not found.=:/)))

      $p_path = ./.$p_path;

      To resolve the issue I modified it with this statement

      if (($p_path == ) // ((substr($p_path, 0, 1) Unable to render embedded object: File (= /) && (substr($p_path, 0, 3) != ../) && (substr($p_path,1,2)) not found.=:/)) // ((substr($p_path, 0, 1) Unable to render embedded object: File (= ) && (substr($p_path, 0, 3) != ..) && (substr($p_path,1,2)) not found.=:)))

      $p_path = ./.$p_path;

      Regards,

      Mustali K

        Activity

        Hide
        Martin Dougiamas added a comment -

        From Martin Dougiamas (martin at moodle.com) Thursday, 25 November 2004, 10:50 PM:

        THanks, Mustali, and thanks for the patch.

        Perhaps this is the problem that most people have been having with SCORM recently?

        Assiging to catalyst for 1.4.3 and cc'ing to stronk and skodak to check it out since they upgraded pclzip in Moodle 1.4.1 +

        From Petr Skoda (skodak at centrum.cz) Friday, 26 November 2004, 03:41 AM:

        Hi!

        First we must update SCORM to use moodlelib.php/unzip_file(), the pclzip and infozip have many problems - AFAIK we have solved them all with Eloy.

        I need some test samples, do you have any?

        There is also new PCLZIP 2.3, we could try it too

        From Petr Skoda (skodak at centrum.cz) Friday, 26 November 2004, 04:11 AM:

        I have patched mod/scorm/details.php and tested it under Win32 - see attachement.

        Please test it in *nix, commit and merge

        For testing I have used:

        http://www.centralquestion.com/Articles/ADLSCORM.html

        skodak

        From Martin Langhoff (martin at catalyst.net.nz) Friday, 26 November 2004, 04:57 AM:

        great, this is moving fast!

        Test environment: MOODLE_14_STABLE, using internal zip/unzip routines, MySQL backend, Debian sarge linux. Browser is Firefox 1.0PR on MacOSX.

        I downloaded the faceismSCORM.zip package to try and trigger the bug pre-patch, but I could not trigger it. Steps:

        • add a new scorm interactive activity to course
        • choose/upload screen, uploaded and chose faceismSCORM.zip
        • accepted defaults, and went for 'review' and used 'enter scorm course'
        • screen pop'ed up, flash movie started, went through the screens and answered all questions. popup closed when done.
        • when returning to the prior page I see it's collected my (dismal) score ok.

        I removed the scorm activity and deleted the zipfile from the 'files' area, applied the patch and re-tested. Same results.

        So I can confirm that the patch works on linux, but cannot repro the bug pre-patch. Is it a Win32-specific bug or maybe I didn't test the right thing?

        From Petr Skoda (skodak at centrum.cz) Friday, 26 November 2004, 05:30 AM:

        This was a known problem on Win32 - see SC#31

        From Martin Langhoff (martin at catalyst.net.nz) Friday, 26 November 2004, 05:33 AM:

        Oh. I had assumed it was win32-specific, but the os field is set to 'all' so I thought I was testing for the wrong thing.

        Can you confirm that my test procedure was ok? If so, I'm committing to STABLE & HEAD

        From Petr Skoda (skodak at centrum.cz) Friday, 26 November 2004, 05:51 AM:

        Yes your procedure was correct, the problem was visible only in Win32.

        From Eloy Lafuente (stronk7 at moodle.org) Friday, 26 November 2004, 07:42 AM:

        Quick and nice work!

        When testing (under my MacOS X with PHP 5.0.2), I discovered that the module is unusable because the XML DOM has changed. I've created MDL-2229 for it.

        And, please, don't be so speedy!! :D B)

        From Martin Langhoff (martin at catalyst.net.nz) Friday, 26 November 2004, 09:00 AM:

        Fixed in HEAD and STABLE. Credits to skodak for repro and fix. Thanks!

        Show
        Martin Dougiamas added a comment - From Martin Dougiamas (martin at moodle.com) Thursday, 25 November 2004, 10:50 PM: THanks, Mustali, and thanks for the patch. Perhaps this is the problem that most people have been having with SCORM recently? Assiging to catalyst for 1.4.3 and cc'ing to stronk and skodak to check it out since they upgraded pclzip in Moodle 1.4.1 + From Petr Skoda (skodak at centrum.cz) Friday, 26 November 2004, 03:41 AM: Hi! First we must update SCORM to use moodlelib.php/unzip_file(), the pclzip and infozip have many problems - AFAIK we have solved them all with Eloy. I need some test samples, do you have any? There is also new PCLZIP 2.3, we could try it too From Petr Skoda (skodak at centrum.cz) Friday, 26 November 2004, 04:11 AM: I have patched mod/scorm/details.php and tested it under Win32 - see attachement. Please test it in *nix, commit and merge For testing I have used: http://www.centralquestion.com/Articles/ADLSCORM.html skodak From Martin Langhoff (martin at catalyst.net.nz) Friday, 26 November 2004, 04:57 AM: great, this is moving fast! Test environment: MOODLE_14_STABLE, using internal zip/unzip routines, MySQL backend, Debian sarge linux. Browser is Firefox 1.0PR on MacOSX. I downloaded the faceismSCORM.zip package to try and trigger the bug pre-patch, but I could not trigger it. Steps: add a new scorm interactive activity to course choose/upload screen, uploaded and chose faceismSCORM.zip accepted defaults, and went for 'review' and used 'enter scorm course' screen pop'ed up, flash movie started, went through the screens and answered all questions. popup closed when done. when returning to the prior page I see it's collected my (dismal) score ok. I removed the scorm activity and deleted the zipfile from the 'files' area, applied the patch and re-tested. Same results. So I can confirm that the patch works on linux, but cannot repro the bug pre-patch. Is it a Win32-specific bug or maybe I didn't test the right thing? From Petr Skoda (skodak at centrum.cz) Friday, 26 November 2004, 05:30 AM: This was a known problem on Win32 - see SC#31 From Martin Langhoff (martin at catalyst.net.nz) Friday, 26 November 2004, 05:33 AM: Oh. I had assumed it was win32-specific, but the os field is set to 'all' so I thought I was testing for the wrong thing. Can you confirm that my test procedure was ok? If so, I'm committing to STABLE & HEAD From Petr Skoda (skodak at centrum.cz) Friday, 26 November 2004, 05:51 AM: Yes your procedure was correct, the problem was visible only in Win32. From Eloy Lafuente (stronk7 at moodle.org) Friday, 26 November 2004, 07:42 AM: Quick and nice work! When testing (under my MacOS X with PHP 5.0.2), I discovered that the module is unusable because the XML DOM has changed. I've created MDL-2229 for it. And, please, don't be so speedy!! : D B ) From Martin Langhoff (martin at catalyst.net.nz) Friday, 26 November 2004, 09:00 AM: Fixed in HEAD and STABLE. Credits to skodak for repro and fix. Thanks!

          People

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

            Dates

            • Created:
              Updated:
              Resolved: