Moodle
  1. Moodle
  2. MDL-44066

Problem restoring SCORM when using file alias

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 2.6.1
    • Fix Version/s: 2.6.3
    • Component/s: Backup, SCORM
    • Labels:
    • Testing Instructions:
      Hide

      set up a file system repository
      Add an extracted SCORM package to this repository
      Add a new SCORM to a course and select the imsmanifest.xml file from within the extracted SCORM package (make sure you select the option to make it an alias/shortcut (not a copy)

      Enter the SCORM and make sure all resources/images/files load as expected.

      more docs (screenshots) of this are available here:
      http://danmarsden.com/blog/2013/09/24/managing-scorm-content-in-moodle-2-6/

      Take a backup of this course and restore into a new course.
      Enter the SCORM and make sure it loads correctly.

      Show
      set up a file system repository Add an extracted SCORM package to this repository Add a new SCORM to a course and select the imsmanifest.xml file from within the extracted SCORM package (make sure you select the option to make it an alias/shortcut (not a copy) Enter the SCORM and make sure all resources/images/files load as expected. more docs (screenshots) of this are available here: http://danmarsden.com/blog/2013/09/24/managing-scorm-content-in-moodle-2-6/ Take a backup of this course and restore into a new course. Enter the SCORM and make sure it loads correctly.
    • Affected Branches:
      MOODLE_26_STABLE
    • Fixed Branches:
      MOODLE_26_STABLE
    • Pull 2.6 Branch:
      m26_MDL-44066
    • Pull Master Branch:
      master_MDL-44066

      Description

      Hello,

      We has several SCORM activities create in a course, all scorms are configured as follows:

      local repository(archive systems)/archive manifest (alias)

      When I restore a backup of this course, scorms don't work in new course.

      The result of restore process:
      setting controller status to 800
      processing file aliases queue
      looking for repository instance by id 9
      successfully restored alias /15497/mod_scorm/package/0/imsmanifest.xml (..URL../imsmanifest.xml)
      setting controller status to 1000
      saving controller to db

      Thanks

        Gliffy Diagrams

          Issue Links

            Activity

            Hide
            Jesús Rincón added a comment -

            We have de last version of Moodle.

            Show
            Jesús Rincón added a comment - We have de last version of Moodle.
            Hide
            Dan Marsden added a comment -

            thanks for the report - unfortunately I won't have time to look at this for a while - but if someone else adds a patch I'll review it asap.

            Show
            Dan Marsden added a comment - thanks for the report - unfortunately I won't have time to look at this for a while - but if someone else adds a patch I'll review it asap.
            Hide
            Dan Marsden added a comment -

            just had an initial look - it appears that restored alias files don't have a source set.

            the failure occurs in filesystem/lib.php send_relative_file()
            $mainfilepath = $mainfile->get_source();

            the restored file returns an empty $mainfilepath instead of the correct path inside the repository.

            Show
            Dan Marsden added a comment - just had an initial look - it appears that restored alias files don't have a source set. the failure occurs in filesystem/lib.php send_relative_file() $mainfilepath = $mainfile->get_source(); the restored file returns an empty $mainfilepath instead of the correct path inside the repository.
            Hide
            Dan Marsden added a comment -

            found the issue - file->source field is not being included in restores - not sure if there was a reason for this Petr Skoda Eloy Lafuente (stronk7) - is this patch ok?

            Show
            Dan Marsden added a comment - found the issue - file->source field is not being included in restores - not sure if there was a reason for this Petr Skoda Eloy Lafuente (stronk7) - is this patch ok?
            Hide
            Eloy Lafuente (stronk7) added a comment -

            Hi Dan,

            I'm afraid, I don't know much about repositories, references and friends. It sounds to me that, for the sake of consistency, sources where left apart in backup & restore on purpose, and only "Moodle filesystem" (aka the file pool) is copied around.

            But I may be wrong, it sounds to me that David Mudrak worked on that repositories stuff and also Andrew Nicols played with files recently when implementing file-less import (backup&restore in the same site). Hope they know more about this than me.

            Ciao

            Show
            Eloy Lafuente (stronk7) added a comment - Hi Dan, I'm afraid, I don't know much about repositories, references and friends. It sounds to me that, for the sake of consistency, sources where left apart in backup & restore on purpose, and only "Moodle filesystem" (aka the file pool) is copied around. But I may be wrong, it sounds to me that David Mudrak worked on that repositories stuff and also Andrew Nicols played with files recently when implementing file-less import (backup&restore in the same site). Hope they know more about this than me. Ciao
            Hide
            CiBoT added a comment -

            Results for MDL-44066

            • Remote repository: git://github.com/danmarsden/moodle.git
            Show
            CiBoT added a comment - Results for MDL-44066 Remote repository: git://github.com/danmarsden/moodle.git Remote branch master_ MDL-44066 to be integrated into upstream master Executed job http://integration.moodle.org/job/Precheck%20remote%20branch/1368 Details: http://integration.moodle.org/job/Precheck%20remote%20branch/1368/artifact/work/smurf.html
            Hide
            David Mudrak added a comment -

            I must admit I can't remember all the details now. Also, IIRC, the interpretation of the $source field has changed since the last time I touched that area. Maybe Marina Glancy will remember more?

            Show
            David Mudrak added a comment - I must admit I can't remember all the details now. Also, IIRC, the interpretation of the $source field has changed since the last time I touched that area. Maybe Marina Glancy will remember more?
            Hide
            Petr Skoda added a comment -

            Sorry, I will not touch this part. I would personally vote for unaliasing everything before restore, but the current design went some other direction unknown to me...

            Show
            Petr Skoda added a comment - Sorry, I will not touch this part. I would personally vote for unaliasing everything before restore, but the current design went some other direction unknown to me...
            Hide
            Dan Marsden added a comment -

            hehe - maybe I should just push up for integration and let an integrator battle it out

            Show
            Dan Marsden added a comment - hehe - maybe I should just push up for integration and let an integrator battle it out
            Hide
            Frédéric Massart added a comment -

            Hi Dan,

            The source field is (AFAIK) used to store some information about the source of the file, but nothing important for aliases to work. I don't see any problem restoring it, but I think this is a bug because of the way the scorm module is using this property.

            I have created an activity using an alias, backed it up, and restored it in another course but same site, and it worked as expected. The files in the SCORM area are restored properly, and still pointing at the same file_reference. After investigating I realised that this worked because my files were at the root of my repository.

            To me the patch is OK, but maybe we should change the file system repository not to rely on the source field any more...

            Marina Glancy could you confirm what I think about the source field?

            Cheers,
            Fred

            Show
            Frédéric Massart added a comment - Hi Dan, The source field is (AFAIK) used to store some information about the source of the file, but nothing important for aliases to work. I don't see any problem restoring it, but I think this is a bug because of the way the scorm module is using this property. I have created an activity using an alias, backed it up, and restored it in another course but same site, and it worked as expected. The files in the SCORM area are restored properly, and still pointing at the same file_reference. After investigating I realised that this worked because my files were at the root of my repository. To me the patch is OK, but maybe we should change the file system repository not to rely on the source field any more... Marina Glancy could you confirm what I think about the source field? Cheers, Fred
            Hide
            Dan Marsden added a comment -

            bouncing this up for integration mainly to get an integrator to look at this - happy for this to be rejected but I suspect we won't get an actual decision until we push for integration. Thanks to the integrators for making the calls on the hard ones!

            Show
            Dan Marsden added a comment - bouncing this up for integration mainly to get an integrator to look at this - happy for this to be rejected but I suspect we won't get an actual decision until we push for integration. Thanks to the integrators for making the calls on the hard ones!
            Hide
            CiBoT added a comment -

            Moving this issue to current integration cycle, will be reviewed soon. Thanks for the hard work!

            Show
            CiBoT added a comment - Moving this issue to current integration cycle, will be reviewed soon. Thanks for the hard work!
            Hide
            Dan Poltawski added a comment -

            Thanks Dan - integrated to master and 26

            Show
            Dan Poltawski added a comment - Thanks Dan - integrated to master and 26
            Hide
            Dan Poltawski added a comment -

            It seems to me like the bug fix is wort doing in the interim to solve this problem. A further refinement sounds like it might be a master-only improvement.

            Show
            Dan Poltawski added a comment - It seems to me like the bug fix is wort doing in the interim to solve this problem. A further refinement sounds like it might be a master-only improvement.
            Hide
            Andrew Davis added a comment -

            I am having trouble with this. I have set up the file repository and created a system level instance. Extracted a scorm package and put it in there.

            When I go to create the scorm activity I select the manifest file and select to make it an alias/shortcut and click "save and display" I get this message

            Only file system repositories are supported when linking directly to an imsmanifest.xml file

            But of course it is a file system repository.

            Show
            Andrew Davis added a comment - I am having trouble with this. I have set up the file repository and created a system level instance. Extracted a scorm package and put it in there. When I go to create the scorm activity I select the manifest file and select to make it an alias/shortcut and click "save and display" I get this message Only file system repositories are supported when linking directly to an imsmanifest.xml file But of course it is a file system repository.
            Hide
            Frédéric Massart added a comment -

            Did you enable the 'relative files support' in the repository settings?

            Show
            Frédéric Massart added a comment - Did you enable the 'relative files support' in the repository settings?
            Hide
            Andrew Davis added a comment -

            Ok, passing this. I have however raised two new MDLs.

            Show
            Andrew Davis added a comment - Ok, passing this. I have however raised two new MDLs.
            Hide
            Eloy Lafuente (stronk7) added a comment -

            The price of success is hard work,
            dedication to the job at hand,
            and the determination that whether we win or lose,
            we have applied the best of ourselves to the task at hand.

            Vince Lombardi

            This is now part of Moodle, your favorite non-frameworkial LMS, LOL. Thanks, closing!

            Ciao

            Show
            Eloy Lafuente (stronk7) added a comment - The price of success is hard work, dedication to the job at hand, and the determination that whether we win or lose, we have applied the best of ourselves to the task at hand. Vince Lombardi This is now part of Moodle, your favorite non-frameworkial LMS, LOL. Thanks, closing! Ciao

              People

              • Votes:
                1 Vote for this issue
                Watchers:
                8 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: