mirror of
https://github.com/moodle/moodle.git
synced 2025-08-06 01:16:44 +02:00
Merge branch 'MDL-67187_master' of git://github.com/dmonllao/moodle
This commit is contained in:
commit
5f1307ef9a
3 changed files with 53 additions and 2 deletions
|
@ -3756,8 +3756,7 @@ function xmldb_main_upgrade($oldversion) {
|
|||
|
||||
if ($oldversion < 2019103000.13) {
|
||||
|
||||
$DB->execute("UPDATE {analytics_models} set contextids = null
|
||||
WHERE contextids = :zero or contextids = :null", ['zero' => '0', 'null' => 'null']);
|
||||
upgrade_analytics_fix_contextids_defaults();
|
||||
|
||||
// Main savepoint reached.
|
||||
upgrade_main_savepoint(true, 2019103000.13);
|
||||
|
|
|
@ -653,3 +653,14 @@ function upgrade_convert_hub_config_site_param_names(stdClass $hubconfig, string
|
|||
|
||||
return (object) $converted;
|
||||
}
|
||||
|
||||
/**
|
||||
* Fix the incorrect default values inserted into analytics contextids field.
|
||||
*/
|
||||
function upgrade_analytics_fix_contextids_defaults() {
|
||||
global $DB;
|
||||
|
||||
$select = $DB->sql_compare_text('contextids') . ' = :zero OR ' . $DB->sql_compare_text('contextids') . ' = :null';
|
||||
$params = ['zero' => '0', 'null' => 'null'];
|
||||
$DB->execute("UPDATE {analytics_models} set contextids = null WHERE " . $select, $params);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue