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

Moodle LTI tool breaks during restore

XMLWordPrintable

    • MOODLE_22_STABLE
    • MOODLE_22_STABLE, MOODLE_23_STABLE
    • Hide

      Important note: As far as all the URLs introduced are fake, none of the activities will deploy any tool at all. That's not the goal for this testing.

      Testing this requires having one sitetool and one coursetool defined. Let's create them:

      A) As admin, go to admin->plugins->activity modules->external tool

      B) Click "Add external tool configuration"

      C) Enter:

      • Tool name: sitetool
      • Tool base URL: http://sitetool.com
      • Check "Show tool type when creating tool instances"
      • Save changes.

      (with this, the site tool is created, it doesn't matter the url is fake)

      D) Create a new course, enable edition and add one External tool activity.

      E) Name of the activity: "A) one automatic sitetool"

      F) Click the + (plus) icon in "External tool type" and fill:

      (with this, the course tool is created, it doesn't matter the url is fake)

      Let's begin testing and creating the required activities:

      1) TEST: We are back to the "Adding a new External Tool" page and the "External tool type" shows: Automatic, based in the URL, sitetool and coursetool (3 options). Name should continue being: "A) one automatic sitetool"

      2) Pick "Automatic, based in the URL" and introduce http://sitetool.com in the "Launch URL" field. And press tab.

      3) TEST: One text with "Using tool configuration: sitetool" is shown.

      4) Save and return to course.

      5) Create a new external tool activity with information:

      • Name: "B) one automatic coursetool"
      • In the dropdown: "Automatic, based in the URL"
      • Launch URL: http://coursetool.com
      • And press tab

      6) TEST: One text with "Using tool configuration: coursetool" is shown.

      7) Save and return to course.

      8) Create a new external tool activity with information:

      • Name: "C) one automatic selftool"
      • In the dropdown: "Automatic, based in the URL"
      • Launch URL: http://selftool.com
      • And press tab

      9) TEST: One text with "Tool configuration not found for this " is shown.

      10) Save and return to course.

      11) Create a new external tool activity with information:

      • Name: "D) one picked sitetool"
      • In the dropdown: "sitetool"

      12) Save and return to course

      13) Create a new external tool activity with information:

      • Name: "E) one picked coursetool"
      • In the dropdown: "coursetool"

      14) Save and return to course

      15) TEST: At this point the course has 5 LTI activities, named, ABCDE

      16) Backup the course (default settings)

      17) Restore the course (default settings) into new course in the same site.

      18) TEST: 5 activities are restored (ABCDE)

      19) TEST: A, B and C retain the introduced settings (name, external tool type and url are the same than the ones in the original course.

      20) TEST: The external tool type drop down shows only 2 options now (Automatic and sitetool), from 3 in the original course. It's one of the things to be fixed by MDL-34161.

      21) TEST: D and E now show "Automatic" in the drop down and there is no URL (lost). Note this is one of the things to be fixed by MDL-34161 too.

      22) Restore the course into different site (not having any site tool defined).

      23) TEST: A, B and C retain the introduced settings (name, external tool type and url are the same than the ones in the original course.

      24) TEST: The external tool type drop down shows only 1 option now (Automatic), from 3 in the original course. It's one of the things to be fixed by MDL-34161.

      25) FINAL TEST: Look to original course and verify that the 5 activities (ABCDE) retain the original settings as specified when created, so the restore operation has not affected them at all in any case.

      26) Tired? NP, this is the END, thanks!

      Show
      Important note: As far as all the URLs introduced are fake, none of the activities will deploy any tool at all. That's not the goal for this testing. Testing this requires having one sitetool and one coursetool defined. Let's create them: A) As admin, go to admin->plugins->activity modules->external tool B) Click "Add external tool configuration" C) Enter: Tool name: sitetool Tool base URL: http://sitetool.com Check "Show tool type when creating tool instances" Save changes. (with this, the site tool is created, it doesn't matter the url is fake) D) Create a new course, enable edition and add one External tool activity. E) Name of the activity: "A) one automatic sitetool" F) Click the + (plus) icon in "External tool type" and fill: Tool name: coursetool Tool base URL: http://coursetool.com Save changes. (with this, the course tool is created, it doesn't matter the url is fake) Let's begin testing and creating the required activities: 1) TEST: We are back to the "Adding a new External Tool" page and the "External tool type" shows: Automatic, based in the URL, sitetool and coursetool (3 options). Name should continue being: "A) one automatic sitetool" 2) Pick "Automatic, based in the URL" and introduce http://sitetool.com in the "Launch URL" field. And press tab. 3) TEST: One text with "Using tool configuration: sitetool" is shown. 4) Save and return to course. 5) Create a new external tool activity with information: Name: "B) one automatic coursetool" In the dropdown: "Automatic, based in the URL" Launch URL: http://coursetool.com And press tab 6) TEST: One text with "Using tool configuration: coursetool" is shown. 7) Save and return to course. 8) Create a new external tool activity with information: Name: "C) one automatic selftool" In the dropdown: "Automatic, based in the URL" Launch URL: http://selftool.com And press tab 9) TEST: One text with "Tool configuration not found for this " is shown. 10) Save and return to course. 11) Create a new external tool activity with information: Name: "D) one picked sitetool" In the dropdown: "sitetool" 12) Save and return to course 13) Create a new external tool activity with information: Name: "E) one picked coursetool" In the dropdown: "coursetool" 14) Save and return to course 15) TEST: At this point the course has 5 LTI activities, named, ABCDE 16) Backup the course (default settings) 17) Restore the course (default settings) into new course in the same site. 18) TEST: 5 activities are restored (ABCDE) 19) TEST: A, B and C retain the introduced settings (name, external tool type and url are the same than the ones in the original course. 20) TEST: The external tool type drop down shows only 2 options now (Automatic and sitetool), from 3 in the original course. It's one of the things to be fixed by MDL-34161 . 21) TEST: D and E now show "Automatic" in the drop down and there is no URL (lost). Note this is one of the things to be fixed by MDL-34161 too. 22) Restore the course into different site (not having any site tool defined). 23) TEST: A, B and C retain the introduced settings (name, external tool type and url are the same than the ones in the original course. 24) TEST: The external tool type drop down shows only 1 option now (Automatic), from 3 in the original course. It's one of the things to be fixed by MDL-34161 . 25) FINAL TEST: Look to original course and verify that the 5 activities (ABCDE) retain the original settings as specified when created, so the restore operation has not affected them at all in any case. 26) Tired? NP, this is the END, thanks!

      After having restored a course containing an instance of mod_lti, the resulting LTI is broken.

      It seems that all restored database records in the mdl_lti table table have typeid = 0. Looking into the code of mod/lti/backup/moodle2/restore_lti_stepslib.php , I see around line 88 that after the restore process we have an IF statement that always evaluates to true and modifies the $basiclti->typeid to 0.

            stronk7 Eloy Lafuente (stronk7)
            monidu Nicolas Dunand
            Dan Poltawski Dan Poltawski
            Sam Hemelryk Sam Hemelryk
            Frédéric Massart Frédéric Massart
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved:

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