From 3c262bb46f487da630dc885f16090f3f50db6153 Mon Sep 17 00:00:00 2001 From: Andrew Nicols Date: Wed, 15 Feb 2023 12:05:02 +0800 Subject: [PATCH] MDL-77248 mod_bigbluebuttonbn: Set dpa accepted when creating activities This only applies when creating activities using the test data generator. --- lib/classes/plugininfo/mod.php | 10 +++++++--- mod/bigbluebuttonbn/tests/generator/lib.php | 1 + 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/lib/classes/plugininfo/mod.php b/lib/classes/plugininfo/mod.php index 8e67f415b72..58bcc54f8f5 100644 --- a/lib/classes/plugininfo/mod.php +++ b/lib/classes/plugininfo/mod.php @@ -52,9 +52,13 @@ class mod extends base { // Only set visibility if it's different from the current value. if ($module->visible != $enabled) { if ($enabled && component_callback_exists("mod_{$pluginname}", 'pre_enable_plugin_actions')) { - // Invoking a callback function that enables plugins to force additional actions (e.g. displaying notifications, - // modals, etc.) and also specify through its returned value (bool) whether the process of enabling the plugin - // should continue after these actions or not. + // This callback may be used to perform actions that must be completed prior to enabling a plugin. + // Example of this may include: + // - making a configuration change + // - adding an alert + // - checking a pre-requisite + // + // If the return value is falsy, then the change will be prevented. if (!component_callback("mod_{$pluginname}", 'pre_enable_plugin_actions')) { return false; } diff --git a/mod/bigbluebuttonbn/tests/generator/lib.php b/mod/bigbluebuttonbn/tests/generator/lib.php index 0f2db867243..544991d2dc6 100644 --- a/mod/bigbluebuttonbn/tests/generator/lib.php +++ b/mod/bigbluebuttonbn/tests/generator/lib.php @@ -50,6 +50,7 @@ class mod_bigbluebuttonbn_generator extends \testing_module_generator { */ public function create_instance($record = null, array $options = null) { // Prior to creating the instance, make sure that the BigBlueButton module is enabled. + set_config('bigbluebuttonbn_default_dpa_accepted', true); $modules = \core_plugin_manager::instance()->get_plugins_of_type('mod'); if (!$modules['bigbluebuttonbn']->is_enabled()) { mod::enable_plugin('bigbluebuttonbn', true);