diff --git a/admin/presets/classes/manager.php b/admin/presets/classes/manager.php index 1fcb43a3c7e..530aa1fcb88 100644 --- a/admin/presets/classes/manager.php +++ b/admin/presets/classes/manager.php @@ -926,13 +926,17 @@ class manager { // Plugins. $plugins = $DB->get_records('adminpresets_app_plug', ['adminpresetapplyid' => $presetappid]); if ($plugins) { + $pluginmanager = \core_plugin_manager::instance(); foreach ($plugins as $plugin) { $pluginclass = \core_plugin_manager::resolve_plugininfo_class($plugin->plugin); $pluginclass::enable_plugin($plugin->name, (int) $plugin->oldvalue); - $visiblename = $plugin->plugin . '_' . $plugin->name; - if (get_string_manager()->string_exists('pluginname', $plugin->plugin . '_' . $plugin->name)) { - $visiblename = get_string('pluginname', $plugin->plugin . '_' . $plugin->name); + // Get the plugininfo object for this plugin, to get its proper visible name. + $plugininfo = $pluginmanager->get_plugin_info($plugin->plugin . '_' . $plugin->name); + if ($plugininfo != null) { + $visiblename = $plugininfo->displayname; + } else { + $visiblename = $plugin->plugin . '_' . $plugin->name; } // Output table. @@ -1087,14 +1091,19 @@ class manager { $strdisabled = get_string('disabled', 'core_adminpresets'); $plugins = $DB->get_records('adminpresets_plug', ['adminpresetid' => $presetid]); + $pluginmanager = \core_plugin_manager::instance(); foreach ($plugins as $plugin) { $pluginclass = \core_plugin_manager::resolve_plugininfo_class($plugin->plugin); $oldvalue = $pluginclass::get_enabled_plugin($plugin->name); - $visiblename = $plugin->plugin . '_' . $plugin->name; - if (get_string_manager()->string_exists('pluginname', $plugin->plugin . '_' . $plugin->name)) { - $visiblename = get_string('pluginname', $plugin->plugin . '_' . $plugin->name); + // Get the plugininfo object for this plugin, to get its proper visible name. + $plugininfo = $pluginmanager->get_plugin_info($plugin->plugin . '_' . $plugin->name); + if ($plugininfo != null) { + $visiblename = $plugininfo->displayname; + } else { + $visiblename = $plugin->plugin . '_' . $plugin->name; } + if ($plugin->enabled > 0) { $visiblevalue = $strenabled; } else if ($plugin->enabled == 0) { diff --git a/admin/tool/admin_presets/tests/behat/apply_presets.feature b/admin/tool/admin_presets/tests/behat/apply_presets.feature index 49746a75cf0..aed01d0a323 100644 --- a/admin/tool/admin_presets/tests/behat/apply_presets.feature +++ b/admin/tool/admin_presets/tests/behat/apply_presets.feature @@ -86,7 +86,7 @@ Feature: I can apply presets And I should see "Server files" in the "Setting changes" "table" And I should see "Show data retention summary" in the "Setting changes" "table" And I should see "Social activities" in the "Setting changes" "table" - And I should see "Social format" in the "format" "table_row" + And I should see "Social format" in the "Setting changes" "table" And I should see "Starred courses" in the "Setting changes" "table" And I should see "Survey" in the "Setting changes" "table" And I should see "Tags" in the "Setting changes" "table" @@ -95,6 +95,9 @@ Feature: I can apply presets And I should see "Wiki" in the "Setting changes" "table" And I should see "Wikimedia" in the "Setting changes" "table" And I should see "Workshop" in the "Setting changes" "table" +# Check filters and data formats strings are displayed properly. + And I should see "Activity names auto-linking" in the "Setting changes" "table" + And I should see "Javascript Object Notation (.json)" in the "Setting changes" "table" # Apply the Starter preset. And I click on "Apply" "button" And I navigate to "Advanced features" in site administration