Skip to content

Commit

Permalink
MDL-80646 mod_lti: Enable key and secret configuration in legacy tools
Browse files Browse the repository at this point in the history
When restoring a manually configured tool to a different site, the key
and secret are not being restored, which is an expected behaviour.
However, legacy (pre-4.3) manually configured tools do not have the
option to configure the key and secret, which makes these instances
unusable. To make sure these tools will continue working after a backup
and restore, we need to re-enable the key and secret fields in the
legacy instance settings form.
  • Loading branch information
Mihail Geshoski committed Mar 5, 2024
1 parent debed3e commit 4753cf3
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
2 changes: 0 additions & 2 deletions mod/lti/mod_form.php
Expand Up @@ -299,8 +299,6 @@ protected function legacy_instance_form_definition(array $instancetypes): void {
'toolurl',
'securetoolurl',
'launchcontainer',
'resourcekey',
'password',
'instructorcustomparameters',
'icon',
'secureicon',
Expand Down
11 changes: 8 additions & 3 deletions mod/lti/tests/behat/addtool.feature
Expand Up @@ -89,7 +89,8 @@ Feature: Add tools
And the "id_showtitlelaunch" "checkbox" should be enabled
And the "id_showdescriptionlaunch" "checkbox" should be enabled
And the "Secure tool URL" "field" should be disabled
And the "Consumer key" "field" should be disabled
And the "Consumer key" "field" should be enabled
And the "Shared secret" "field" should be enabled
And I click on "Reveal" "icon"
And I should see "secret"
And the "Custom parameters" "field" should be disabled
Expand All @@ -104,6 +105,8 @@ Feature: Add tools
And I set the following fields to these values:
| Activity name | A manual tool name edited |
| id_showdescription | 1 |
| Consumer key | key |
| Shared secret | secret |
And I press "Save and return to course"
And I am on the "A manual tool" "lti activity editing" page logged in as teacher1
And I follow "Show more..."
Expand All @@ -112,7 +115,8 @@ Feature: Add tools
And the following fields match these values:
| Activity name | A manual tool name edited |
| id_showdescription | 1 |
| Consumer key | 12345 |
| Consumer key | key |
| Shared secret | secret |
| Icon URL | http://download.moodle.org/unittest/test.jpg |
| Secure icon URL | https://download.moodle.org/unittest/test.jpg |
| Tool URL | http://www.example.com/lti/provider.php |
Expand All @@ -125,7 +129,8 @@ Feature: Add tools
And the "id_showtitlelaunch" "checkbox" should be enabled
And the "id_showdescriptionlaunch" "checkbox" should be enabled
And the "Secure tool URL" "field" should be disabled
And the "Consumer key" "field" should be disabled
And the "Consumer key" "field" should be enabled
And the "Shared secret" "field" should be enabled
And I click on "Reveal" "icon"
And I should see "secret"
And the "Custom parameters" "field" should be disabled
Expand Down

0 comments on commit 4753cf3

Please sign in to comment.