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

LTI upgrade breaks during CLI upgrade due to call to undefined function grade_update()

XMLWordPrintable

    • MOODLE_33_STABLE, MOODLE_34_STABLE
    • MOODLE_33_STABLE, MOODLE_34_STABLE
    • MDL-60914_master
    • Hide
      Setup
      1. Expose your local server to the internet using ngrok.
      2. Replace the domain part of your $CFG->wwwroot in config.php to the address displayed by ngrok.
        e.g.
        From

        http://localhost/integration_master


        To

        http://[somehash].ngrok.io/integration_master

        Note: If you're using MDK, you may simply run the following command

        mdk config set host [somehash].ngrok.io
        

        Then run "mdk doctor --fix --all"

      Test
      1. Create a fresh moodle site. Or if you are using MDK and you already have Moodle sites installed, simply uninstall your Moodle site by running the command "mdk uninstall -y [SITE_NAME]".
        e.g. If you already have integration_master, run

        mdk uninstall -y integration_master
        

      2. Still on the terminal, go to your Moodle instance's root folder.
      3. Using Git, check out the commit before the fix for ---MDL-60187--- got integrated:
        • For 33

          git checkout 2a626230eed364e7a8d7edc

        • For 34

          git checkout 6da402bf347eb2d752e6ef181

        • For master

          git checkout 4275ea4a43a9945abc0e

      4. Enter the following command:

        git log --grep="MDL-60187"

        • Confirm nothing is returned.
      5. Install your site. If you're using MDK, simply run

        mdk install -r mindev users
        

      6. Open your browser and log in as an admin.
      7. Create a course.
      8. Add an 'External tool' to your course.
      9. Set the Tool URL to "http://lti.tools/test/tp.php"
      10. Expand the form ("Show more...")
      11. Enter "testkey" for the Consumer key field.
      12. Enter "secret" for the Shared secret field.
      13. Under Privacy, make sure that 'Accept grades from the tool' is not checked.
      14. Save and return to the course.
      15. On the course page, rename the external tool by activity clicking on the pencil icon beside it.
      16. On the side panel, click on "Grades"
      17. Check the "Grader report now contains the external tool activity
      18. Back on the command line terminal and on your moodle instance's root directory, checkout the latest integration branch to update your code to the latest.
        • For 33

          git checkout MOODLE_33_STABLE && git fetch origin && git reset --hard origin/MOODLE_33_STABLE

        • For 34

          git checkout MOODLE_34_STABLE && git fetch origin && git reset --hard origin/MOODLE_34_STABLE

        • For 35

          git checkout master && git fetch origin && git reset --hard origin/master

      19. Do git log -grep="--MDL-60187---" and confirm a commit is returned.
      20. Do git log --grep="MDL-60914" and confirm a commit is returned.
      21. Run a CLI upgrade by entering the command:

        php admin/cli/upgrade.php
        

        • Confirm that the site get's successfully upgraded and that you don't encounter any error.
      22. Back on your browser, go back to the course's "Grader report" page.
        • Confirm the external tool activity is no longer shown in the grader report.
      Show
      Setup Expose your local server to the internet using ngrok. Replace the domain part of your $CFG->wwwroot in config.php to the address displayed by ngrok. e.g. From http://localhost/integration_master To http://[somehash].ngrok.io/integration_master Note: If you're using MDK, you may simply run the following command mdk config set host [somehash].ngrok.io Then run " mdk doctor --fix --all " Test Create a fresh moodle site. Or if you are using MDK and you already have Moodle sites installed, simply uninstall your Moodle site by running the command " mdk uninstall -y [SITE_NAME] ". e.g. If you already have integration_master, run mdk uninstall -y integration_master Still on the terminal, go to your Moodle instance's root folder. Using Git, check out the commit before the fix for --- MDL-60187 --- got integrated: For 33 git checkout 2a626230eed364e7a8d7edc For 34 git checkout 6da402bf347eb2d752e6ef181 For master git checkout 4275ea4a43a9945abc0e Enter the following command: git log --grep="MDL-60187" Confirm nothing is returned. Install your site. If you're using MDK, simply run mdk install -r mindev users Open your browser and log in as an admin. Create a course. Add an 'External tool' to your course. Set the Tool URL to " http://lti.tools/test/tp.php " Expand the form ("Show more...") Enter "testkey" for the Consumer key field. Enter "secret" for the Shared secret field. Under Privacy, make sure that 'Accept grades from the tool' is not checked. Save and return to the course. On the course page, rename the external tool by activity clicking on the pencil icon beside it. On the side panel, click on " Grades " Check the " Grader report now contains the external tool activity Back on the command line terminal and on your moodle instance's root directory, checkout the latest integration branch to update your code to the latest. For 33 git checkout MOODLE_33_STABLE && git fetch origin && git reset --hard origin/MOODLE_33_STABLE For 34 git checkout MOODLE_34_STABLE && git fetch origin && git reset --hard origin/MOODLE_34_STABLE For 35 git checkout master && git fetch origin && git reset --hard origin/master Do git log - grep=" -- MDL-60187 ---" and confirm a commit is returned. Do git log --grep=" MDL-60914 " and confirm a commit is returned. Run a CLI upgrade by entering the command: php admin/cli/upgrade.php Confirm that the site get's successfully upgraded and that you don't encounter any error. Back on your browser, go back to the course's " Grader report " page. Confirm the external tool activity is no longer shown in the grader report.

      Reported in MDL-60187.

      This change failed to upgrade on 
       
      3.3.3+ (BUILD: 20171123) (2017051503.03)
       
      Error code: generalexceptionmessage
          line 259 of /mod/lti/db/upgrade.php: Error thrown
          line 738 of /lib/upgradelib.php: call to xmldb_lti_upgrade()
          line 444 of /lib/upgradelib.php: call to upgrade_plugins_modules()
          line 1754 of /lib/upgradelib.php: call to upgrade_plugins()
          line 181 of /admin/cli/upgrade.php: call to upgrade_noncore()
       
      !!! Exception - Call to undefined function grade_update() !!!
       
      Error code: generalexceptionmessage !!
       
      !! Stack trace: * line 259 of /mod/lti/db/upgrade.php: Error thrown
          line 738 of /lib/upgradelib.php: call to xmldb_lti_upgrade()
          line 444 of /lib/upgradelib.php: call to upgrade_plugins_modules()
          line 1754 of /lib/upgradelib.php: call to upgrade_plugins()
          line 181 of /admin/cli/upgrade.php: call to upgrade_noncore()
      

            markn Mark Nelson
            markn Mark Nelson
            Simey Lameze Simey Lameze
            Jun Pataleta Jun Pataleta
            Rayna Mae Jayco Rayna Mae Jayco
            Votes:
            1 Vote for this issue
            Watchers:
            8 Start watching this issue

              Created:
              Updated:
              Resolved:

                Error rendering 'clockify-timesheets-time-tracking-reports:timer-sidebar'. Please contact your Jira administrators.