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

Missing library includes in quiz upgrade from 1.9 to 2.1

    Details

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

      This is actually really hard to test, unless you do have a very old Moodle around. Anyway, this is the correct testing procedure. I must admin that I could not be bothered to do it myself:

      1. Install Moodle 1.4.
      2. Create a quiz, attempt it as a student. Perhaps complete one attempt, and leave another one in mid-attempt.
      3. Upgrade to 1.9, which probably involves going via 1.6 and Unicode upgrade.
      – Keep a backup of this Moodle site in this state, so we can repeat the test if necessary.
      4. Upgrade to 2.1. Verify no errors occur. Verify that when you review the quiz attempts, it all looks OK.

      If there are any problems, go back to the 1.9 backup, and see if the problem was in the upgrade 1.9 -> 2.1 or earlier than that. If it was earlier than that, it will be deeply depressing.

      Alternatively, we could just hope that Henning Bostelmann (who reported the bug) is able to test these changes for us.

      Show
      This is actually really hard to test, unless you do have a very old Moodle around. Anyway, this is the correct testing procedure. I must admin that I could not be bothered to do it myself: 1. Install Moodle 1.4. 2. Create a quiz, attempt it as a student. Perhaps complete one attempt, and leave another one in mid-attempt. 3. Upgrade to 1.9, which probably involves going via 1.6 and Unicode upgrade. – Keep a backup of this Moodle site in this state, so we can repeat the test if necessary. 4. Upgrade to 2.1. Verify no errors occur. Verify that when you review the quiz attempts, it all looks OK. If there are any problems, go back to the 1.9 backup, and see if the problem was in the upgrade 1.9 -> 2.1 or earlier than that. If it was earlier than that, it will be deeply depressing. Alternatively, we could just hope that Henning Bostelmann (who reported the bug) is able to test these changes for us.
    • Affected Branches:
      MOODLE_21_STABLE
    • Fixed Branches:
      MOODLE_21_STABLE
    • Pull from Repository:
    • Pull Master Branch:

      Description

      While upgrading a Moodle 1.9 database to Moodle 2.1(beta), during the mod/quiz upgrade, the following error is encountered.

      Fatal error: Call to undefined function quiz_upgrade_very_old_question_sessions() in /home/bostelm/apps/git/mathsmoodle.git/mod/quiz/db/upgrade.php on line 574

      It appears that the script doesn't include upgradelib.php in the same directory. (However, I tried to include this library and this only leads to a different "undefined function" error.)

        Gliffy Diagrams

          Issue Links

            Activity

            bostelm Henning Bostelmann created issue -
            timhunt Tim Hunt made changes -
            Field Original Value New Value
            Fix Version/s 2.1 [ 10370 ]
            Labels triaged
            timhunt Tim Hunt made changes -
            Link This issue blocks MDL-27738 [ MDL-27738 ]
            timhunt Tim Hunt made changes -
            Status Open [ 1 ] Waiting for integration review [ 10010 ]
            Pull Master Diff URL https://github.com/timhunt/moodle/compare/master...MDL-28055
            Pull Master Branch MDL-28055
            Pull from Repository git://github.com/timhunt/moodle.git
            Testing Instructions * Start from Moodle 1.9 installation (DB and filesystem data) - sorry, I tested this with a copy of our "real" Moodle only
            * Install Moodle 2.1 scripts
            * Run upgrade routine
            * Proceed until mod/quiz upgrade
            This is actually really hard to test, unless you do have a very old Moodle around. Anyway, this is the correct testing procedure. I must admin that I could not be bothered to do it myself:

            1. Install Moodle 1.4.
            2. Create a quiz, attempt it as a student. Perhaps complete one attempt, and leave another one in mid-attempt.
            3. Upgrade to 1.9, which probably involves going via 1.6 and Unicode upgrade.
             -- Keep a backup of this Moodle site in this state, so we can repeat the test if necessary.
            4. Upgrade to 2.1. Verify no errors occur. Verify that when you review the quiz attempts, it all looks OK.

            If there are any problems, go back to the 1.9 backup, and see if the problem was in the upgrade 1.9 -> 2.1 or earlier than that. If it was earlier than that, it will be deeply depressing.

            Alternatively, we could just hope that Henning Bostelmann (who reported the bug) is able to test these changes for us.
            Hide
            bostelm Henning Bostelmann added a comment -

            Hi Tim,

            I'm currently starting development work on our "local upgrade" from Moodle 1.9 to 2.1, and I'm happy to do the testing using a copy of our live data.

            We're currently running Moodle 1.9, but the Moodle installation is very old and the database has undergone several migration steps before - from 1.6 previously, I'm not sure about the steps before that.

            Show
            bostelm Henning Bostelmann added a comment - Hi Tim, I'm currently starting development work on our "local upgrade" from Moodle 1.9 to 2.1, and I'm happy to do the testing using a copy of our live data. We're currently running Moodle 1.9, but the Moodle installation is very old and the database has undergone several migration steps before - from 1.6 previously, I'm not sure about the steps before that.
            Hide
            timhunt Tim Hunt added a comment -

            Great. Are you able to get the code changes from https://github.com/timhunt/moodle/compare/master...MDL-28055 and try an upgrade of a copy of your site using those? Thanks.

            Show
            timhunt Tim Hunt added a comment - Great. Are you able to get the code changes from https://github.com/timhunt/moodle/compare/master...MDL-28055 and try an upgrade of a copy of your site using those? Thanks.
            Hide
            bostelm Henning Bostelmann added a comment -

            I applied the changes, and ran the update routine on my data. The upgrade of the quiz module and of the questions runs now, but produces a lot of error / warning messages. I have copied samples below. Each of these appears in hundreds of copies. (I have left out some messages that are related to a custom question type which I haven't migrated yet.)

            It may be that these messages refer to inconsistencies in our data - posting them here just to be sure.

            Messages seen during "Upgrading very old quiz attempts":


            Notice: Undefined variable: layout in /home/bostelm/apps/git/mathsmoodle.git/mod/quiz/db/upgradelib.php on line 62


            Messages seen during "Upgrading quiz attempts":


            Notice: Undefined variable: question in /home/bostelm/apps/git/mathsmoodle.git/question/engine/upgrade/upgradelib.php on line 213
            Notice: Trying to get property of non-object in /home/bostelm/apps/git/mathsmoodle.git/question/engine/upgrade/upgradelib.php on line 361
            Notice: Trying to get property of non-object in /home/bostelm/apps/git/mathsmoodle.git/question/engine/upgrade/upgradelib.php on line 344
            Notice: Trying to get property of non-object in /home/bostelm/apps/git/mathsmoodle.git/question/engine/upgrade/upgradelib.php on line 346
            Notice: Trying to get property of non-object in /home/bostelm/apps/git/mathsmoodle.git/question/engine/upgrade/behaviourconverters.php on line 266
            Notice: Trying to get property of non-object in /home/bostelm/apps/git/mathsmoodle.git/question/engine/upgrade/behaviourconverters.php on line 268
            Coding error detected, it must be fixed by a programmer: Question type is missing important code (the file /home/bostelm/apps/git/mathsmoodle.git/question/type//db/upgradelib.php) required to run the upgrade to the new question engine.


            Question sessions for questions 36, 37, 79, 80, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 59, 56, 57, 58, 55, 60, 61, 63, 64, 65, 67, 68, 66, 81, 70, 71, 78, 62, 69, 72, 73, 74, 75, 76, 77 were missing when upgrading question usage 15.


            Notice: Uninitialized string offset: 1 in /home/bostelm/apps/git/mathsmoodle.git/question/type/calculated/db/upgradelib.php on line 115 Notice: Uninitialized string offset: 0 in /home/bostelm/apps/git/mathsmoodle.git/question/type/calculated/db/upgradelib.php on line 115

            Show
            bostelm Henning Bostelmann added a comment - I applied the changes, and ran the update routine on my data. The upgrade of the quiz module and of the questions runs now, but produces a lot of error / warning messages. I have copied samples below. Each of these appears in hundreds of copies. (I have left out some messages that are related to a custom question type which I haven't migrated yet.) It may be that these messages refer to inconsistencies in our data - posting them here just to be sure. Messages seen during "Upgrading very old quiz attempts": Notice: Undefined variable: layout in /home/bostelm/apps/git/mathsmoodle.git/mod/quiz/db/upgradelib.php on line 62 Messages seen during "Upgrading quiz attempts": Notice: Undefined variable: question in /home/bostelm/apps/git/mathsmoodle.git/question/engine/upgrade/upgradelib.php on line 213 Notice: Trying to get property of non-object in /home/bostelm/apps/git/mathsmoodle.git/question/engine/upgrade/upgradelib.php on line 361 Notice: Trying to get property of non-object in /home/bostelm/apps/git/mathsmoodle.git/question/engine/upgrade/upgradelib.php on line 344 Notice: Trying to get property of non-object in /home/bostelm/apps/git/mathsmoodle.git/question/engine/upgrade/upgradelib.php on line 346 Notice: Trying to get property of non-object in /home/bostelm/apps/git/mathsmoodle.git/question/engine/upgrade/behaviourconverters.php on line 266 Notice: Trying to get property of non-object in /home/bostelm/apps/git/mathsmoodle.git/question/engine/upgrade/behaviourconverters.php on line 268 Coding error detected, it must be fixed by a programmer: Question type is missing important code (the file /home/bostelm/apps/git/mathsmoodle.git/question/type//db/upgradelib.php) required to run the upgrade to the new question engine. Question sessions for questions 36, 37, 79, 80, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 59, 56, 57, 58, 55, 60, 61, 63, 64, 65, 67, 68, 66, 81, 70, 71, 78, 62, 69, 72, 73, 74, 75, 76, 77 were missing when upgrading question usage 15. Notice: Uninitialized string offset: 1 in /home/bostelm/apps/git/mathsmoodle.git/question/type/calculated/db/upgradelib.php on line 115 Notice: Uninitialized string offset: 0 in /home/bostelm/apps/git/mathsmoodle.git/question/type/calculated/db/upgradelib.php on line 115
            stronk7 Eloy Lafuente (stronk7) made changes -
            Status Waiting for integration review [ 10010 ] Integration review in progress [ 10004 ]
            Integrator stronk7
            Currently in integration Yes
            Hide
            stronk7 Eloy Lafuente (stronk7) added a comment -

            Integrated, thanks!

            Surely we must end this by requiring 2.2 to upgrade from 2.1 only or so.

            Show
            stronk7 Eloy Lafuente (stronk7) added a comment - Integrated, thanks! Surely we must end this by requiring 2.2 to upgrade from 2.1 only or so.
            stronk7 Eloy Lafuente (stronk7) made changes -
            Status Integration review in progress [ 10004 ] Waiting for testing [ 10005 ]
            Hide
            leebrent Brent Lee added a comment -

            Eloy: Yes! Require 2.1 for 2.2.

            Show
            leebrent Brent Lee added a comment - Eloy: Yes! Require 2.1 for 2.2.
            moodle.com moodle.com made changes -
            Tester aborrow
            aborrow Anthony Borrow made changes -
            Status Waiting for testing [ 10005 ] Testing in progress [ 10011 ]
            Hide
            aborrow Anthony Borrow added a comment -

            This is a really remote scenario dealing with an upgrade from Moodle 1.4. Due to the rarity of the issue, I will leave any significant testing of this to Henning. Hopefully folks will be upgrading from one major version of Moodle to the next. If Henning runs into any problems he can certainly comment here and let us know but I doubt many others will be affected by this. Peace - Anthony

            Show
            aborrow Anthony Borrow added a comment - This is a really remote scenario dealing with an upgrade from Moodle 1.4. Due to the rarity of the issue, I will leave any significant testing of this to Henning. Hopefully folks will be upgrading from one major version of Moodle to the next. If Henning runs into any problems he can certainly comment here and let us know but I doubt many others will be affected by this. Peace - Anthony
            aborrow Anthony Borrow made changes -
            Status Testing in progress [ 10011 ] Tested [ 10006 ]
            dougiamas Martin Dougiamas made changes -
            Fix Version/s 2.1.1 [ 10750 ]
            Fix Version/s 2.1 [ 10370 ]
            Hide
            stronk7 Eloy Lafuente (stronk7) added a comment -

            Super!

            Show
            stronk7 Eloy Lafuente (stronk7) added a comment - Super!
            stronk7 Eloy Lafuente (stronk7) made changes -
            Status Tested [ 10006 ] Closed [ 6 ]
            Fix Version/s 2.1 [ 10370 ]
            Fix Version/s 2.1.1 [ 10750 ]
            Resolution Fixed [ 1 ]
            Currently in integration Yes
            Integration date 1/Jul/11
            Subversion JIRA

            Links Hierarchy

             Documentation

            Invalid license: EXPIRED

              People

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

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Fix Release Date:
                  1/Jul/11