Skip to content

Commit

Permalink
Fix issue with Moodle 4.1 that user add page is not displayed.
Browse files Browse the repository at this point in the history
  • Loading branch information
srobotta committed Oct 18, 2024
1 parent 78f549b commit 2fcaec3
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 0 deletions.
7 changes: 7 additions & 0 deletions classes/plugininfo.php
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,13 @@ public static function get_plugin_configuration_for_context(
'testsite' => false,
'multianswerrgx' => false,
];

// In Moodle 4.1 in /user/editadvanced.php the class question_bank is not found. So
// multianswerrgx is not supported with 4.1.
if (moodle_major_version() < 4.2) {
return $config;
}

try {
// Check if the multianswerrgx question type is available.
$instance = question_bank::get_qtype('multianswerrgx');
Expand Down
17 changes: 17 additions & 0 deletions tests/behat/user.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
@editor @tiny @editor_tiny @tiny_cloze @javascript
Feature: Check that the user edit page appears and no exception is thrown.

Background:
Given the following "courses" exist:
| fullname | shortname |
| Course fullname | C_shortname |
And the following "user preferences" exist:
| user | preference | value |
| admin | htmleditor | tiny |
And I log in as "admin"

@javascript
Scenario: Open the page to add a user
When I navigate to "Users > Add a new user" in site administration
Then I should see "First name"
And I click on the "Image" button for the "Description" TinyMCE editor

0 comments on commit 2fcaec3

Please sign in to comment.