Skip to content

Commit

Permalink
Merge branch 'MDL-73747-master' of https://github.com/aanabit/moodle
Browse files Browse the repository at this point in the history
  • Loading branch information
junpataleta committed Feb 28, 2022
2 parents fa2121e + acca36d commit 396f90d
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 1 deletion.
23 changes: 23 additions & 0 deletions lib/db/upgrade.php
Expand Up @@ -3651,6 +3651,8 @@ function xmldb_main_upgrade($oldversion) {
// Save locked.
if ($locked) {
set_config($provider.'_provider_'.$prefname.'_locked', 1, 'message');
} else {
set_config($provider.'_provider_'.$prefname.'_locked', 0, 'message');
}
// Remove old value.
unset_config($provider.'_provider_'.$prefname.'_permitted', 'message');
Expand Down Expand Up @@ -4107,5 +4109,26 @@ function xmldb_main_upgrade($oldversion) {
upgrade_main_savepoint(true, 2022021100.02);
}

if ($oldversion < 2022022600.01) {
// Get all processor and existing preferences.
$processors = $DB->get_records('message_processors');
$providers = $DB->get_records('message_providers', null, '', 'id, name, component');
$existingpreferences = get_config('message');

foreach ($processors as $processor) {
foreach ($providers as $provider) {
// Setting default preference name.
$componentproviderbase = $provider->component . '_' . $provider->name;
$preferencename = $processor->name.'_provider_'.$componentproviderbase.'_locked';
// If we do not have this setting yet, set it to 0.
if (!isset($existingpreferences->{$preferencename})) {
set_config($preferencename, 0, 'message');
}
}
}

upgrade_main_savepoint(true, 2022022600.01);
}

return true;
}
2 changes: 1 addition & 1 deletion version.php
Expand Up @@ -29,7 +29,7 @@

defined('MOODLE_INTERNAL') || die();

$version = 2022022600.00; // YYYYMMDD = weekly release date of this DEV branch.
$version = 2022022600.01; // YYYYMMDD = weekly release date of this DEV branch.
// RR = release increments - 00 in DEV branches.
// .XX = incremental changes.
$release = '4.0dev+ (Build: 20220226)'; // Human-friendly version name
Expand Down

0 comments on commit 396f90d

Please sign in to comment.