MDL-77248 mod_bigbluebuttonbn: Set dpa accepted when creating activities

This only applies when creating activities using the test data
generator.
This commit is contained in:
Andrew Nicols 2023-02-15 12:05:02 +08:00
parent 9d5e363b41
commit 3c262bb46f
2 changed files with 8 additions and 3 deletions

View File

@ -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;
}

View File

@ -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);