diff --git a/.upgradenotes/MDL-84309-2025021520382010.yml b/.upgradenotes/MDL-84309-2025021520382010.yml new file mode 100644 index 00000000000..69d393ba129 --- /dev/null +++ b/.upgradenotes/MDL-84309-2025021520382010.yml @@ -0,0 +1,5 @@ +issueNumber: MDL-84309 +notes: + core_adminpresets: + - message: Removed block_mnet_hosts from admin presets + type: removed diff --git a/admin/presets/classes/helper.php b/admin/presets/classes/helper.php index cba8576777f..4ea6e584883 100644 --- a/admin/presets/classes/helper.php +++ b/admin/presets/classes/helper.php @@ -207,7 +207,7 @@ class helper { static::add_plugin($presetid, 'availability', 'profile', false); // Blocks: Hide Activities, Blog menu, Blog tags, Comments, Course completion status, Courses, Flickr, - // Global search, Latest badges, Learning plans, Logged in user, Login, Main menu, Mentees, Network servers, Online users, + // Global search, Latest badges, Learning plans, Logged in user, Login, Main menu, Mentees, Online users, // Private files, Recent blog entries, Recently accessed courses, Search forums, Section links, Social activities, // Starred courses, Tags, YouTube. // Hidden by default: Course/site summary, RSS feeds, Self completion, Feedback. @@ -226,7 +226,6 @@ class helper { static::add_plugin($presetid, 'block', 'login', false); static::add_plugin($presetid, 'block', 'site_main_menu', false); static::add_plugin($presetid, 'block', 'mentees', false); - static::add_plugin($presetid, 'block', 'mnet_hosts', false); static::add_plugin($presetid, 'block', 'private_files', false); static::add_plugin($presetid, 'block', 'blog_recent', false); static::add_plugin($presetid, 'block', 'rss_client', false); @@ -313,7 +312,7 @@ class helper { static::add_plugin($presetid, 'availability', 'profile', true); // Blocks: Enable Activities, Blog menu, Blog tags, Comments, Course completion status, Courses, Flickr, - // Global search, Latest badges, Learning plans, Logged in user, Login, Main menu, Mentees, Network servers, Online users, + // Global search, Latest badges, Learning plans, Logged in user, Login, Main menu, Mentees, Online users, // Private files, Recent blog entries, Recently accessed courses, Search forums, Section links, Social activities, // Starred courses, Tags, YouTube. // Hidden by default: Course/site summary, RSS feeds, Self completion, Feedback. @@ -331,7 +330,6 @@ class helper { static::add_plugin($presetid, 'block', 'login', true); static::add_plugin($presetid, 'block', 'site_main_menu', true); static::add_plugin($presetid, 'block', 'mentees', true); - static::add_plugin($presetid, 'block', 'mnet_hosts', true); static::add_plugin($presetid, 'block', 'private_files', true); static::add_plugin($presetid, 'block', 'blog_recent', true); static::add_plugin($presetid, 'block', 'search_forums', true); diff --git a/admin/tool/admin_presets/tests/behat/apply_presets.feature b/admin/tool/admin_presets/tests/behat/apply_presets.feature index 04c27d21a8a..32bb40bd21b 100644 --- a/admin/tool/admin_presets/tests/behat/apply_presets.feature +++ b/admin/tool/admin_presets/tests/behat/apply_presets.feature @@ -73,7 +73,6 @@ Feature: I can apply presets And "Maximum number of attachments" row "Current value" column of "Setting changes" table should contain "9" And "Maximum number of attachments" row "New value" column of "Setting changes" table should contain "3" And I should see "Mentees" in the "Setting changes" "table" - And I should see "Network servers" in the "Setting changes" "table" And I should see "Numerical" in the "Setting changes" "table" And I should see "Online users" in the "Setting changes" "table" And I should see "Private files" in the "Setting changes" "table" diff --git a/admin/tool/behat/tests/behat/edit_permissions.feature b/admin/tool/behat/tests/behat/edit_permissions.feature index 3ce97abb3bf..da2406036b5 100644 --- a/admin/tool/behat/tests/behat/edit_permissions.feature +++ b/admin/tool/behat/tests/behat/edit_permissions.feature @@ -25,13 +25,13 @@ Feature: Edit capabilities And I click on "Edit Teacher role" "link" And I fill the capabilities form with the following permissions: | capability | permission | - | block/mnet_hosts:myaddinstance | Allow | + | block/online_users:myaddinstance | Allow | | moodle/site:messageanyuser | Inherit | | moodle/grade:managesharedforms | Prevent | | moodle/course:request | Prohibit | And I press "Save changes" When I follow "Edit Teacher role" - Then "block/mnet_hosts:myaddinstance" capability has "Allow" permission + Then "block/online_users:myaddinstance" capability has "Allow" permission And "moodle/site:messageanyuser" capability has "Not set" permission And "moodle/grade:managesharedforms" capability has "Prevent" permission And "moodle/course:request" capability has "Prohibit" permission diff --git a/lib/db/upgrade.php b/lib/db/upgrade.php index 15d33dda83d..d4af25944b2 100644 --- a/lib/db/upgrade.php +++ b/lib/db/upgrade.php @@ -1495,7 +1495,11 @@ function xmldb_main_upgrade($oldversion) { if ($oldversion < 2025030400.04) { if (!file_exists($CFG->dirroot . "/blocks/mnet_hosts/version.php")) { uninstall_plugin('block', 'mnet_hosts'); + + // Delete all the admin preset plugin states concerning mnet_hosts in adminpresets_plug table. + $DB->delete_records('adminpresets_plug', ['name' => 'mnet_hosts']); } + // Main savepoint reached. upgrade_main_savepoint(true, 2025030400.04); } diff --git a/lib/plugins.json b/lib/plugins.json index e0fbdd8a603..066f5cd5a74 100644 --- a/lib/plugins.json +++ b/lib/plugins.json @@ -100,7 +100,6 @@ "login", "lp", "mentees", - "mnet_hosts", "myoverview", "myprofile", "navigation", @@ -584,6 +583,7 @@ "community", "course_overview", "messages", + "mnet_hosts", "participants", "quiz_results" ], diff --git a/lib/tests/component_test.php b/lib/tests/component_test.php index da365e6acc5..0355e068c9b 100644 --- a/lib/tests/component_test.php +++ b/lib/tests/component_test.php @@ -318,7 +318,7 @@ final class component_test extends \advanced_testcase { $this->assertSame('auth_mnet', component::normalize_componentname('auth_mnet')); $this->assertSame('enrol_self', component::normalize_componentname('enrol_self')); $this->assertSame('block_html', component::normalize_componentname('block_html')); - $this->assertSame('block_mnet_hosts', component::normalize_componentname('block_mnet_hosts')); + $this->assertSame('auth_oauth2', component::normalize_componentname('auth_oauth2')); $this->assertSame('local_amos', component::normalize_componentname('local_amos')); $this->assertSame('local_admin', component::normalize_componentname('local_admin')); @@ -396,7 +396,7 @@ final class component_test extends \advanced_testcase { [['auth', 'mnet'], 'auth_mnet'], [['enrol', 'self'], 'enrol_self'], [['block', 'html'], 'block_html'], - [['block', 'mnet_hosts'], 'block_mnet_hosts'], + [['auth', 'oauth2'], 'auth_oauth2'], [['local', 'amos'], 'local_amos'], [['local', 'admin'], 'local_admin'],