MDL-80943 reportbuilder: Fix bad conflict resolution.

This commit is contained in:
Ilya Tregubov
2024-03-08 09:35:55 +08:00
parent 82859f1848
commit 96c9fd4b16
+14 -12
View File
@@ -1106,26 +1106,28 @@ function xmldb_main_upgrade($oldversion) {
upgrade_main_savepoint(true, 2024030500.01);
}
if ($oldversion < 2024030500.02) {
}
// Get all "select" custom field shortnames.
$fieldshortnames = $DB->get_fieldset('customfield_field', 'shortname', ['type' => 'select']);
if ($oldversion < 2024030500.02) {
// Ensure any used in custom reports columns are not using integer type aggregation.
foreach ($fieldshortnames as $fieldshortname) {
$DB->execute("
// Get all "select" custom field shortnames.
$fieldshortnames = $DB->get_fieldset('customfield_field', 'shortname', ['type' => 'select']);
// Ensure any used in custom reports columns are not using integer type aggregation.
foreach ($fieldshortnames as $fieldshortname) {
$DB->execute("
UPDATE {reportbuilder_column}
SET aggregation = NULL
WHERE " . $DB->sql_like('uniqueidentifier', ':uniqueidentifier', false) . "
AND aggregation IN ('avg', 'max', 'min', 'sum')
", [
'uniqueidentifier' => '%' . $DB->sql_like_escape(":customfield_{$fieldshortname}"),
]);
}
// Main savepoint reached.
upgrade_main_savepoint(true, 2024030500.02);
'uniqueidentifier' => '%' . $DB->sql_like_escape(":customfield_{$fieldshortname}"),
]);
}
// Main savepoint reached.
upgrade_main_savepoint(true, 2024030500.02);
}
return true;
}