mirror of
https://github.com/moodle/moodle.git
synced 2025-08-05 08:56:36 +02:00
Merge branch 'm40_MDL-70042_Progress_Bar_Upgrade_Message_Popup' of https://github.com/scara/moodle
This commit is contained in:
commit
131dacceb5
1 changed files with 14 additions and 12 deletions
|
@ -51,19 +51,21 @@ function xmldb_message_popup_upgrade($oldversion) {
|
||||||
ON mpn.notificationid = n.id
|
ON mpn.notificationid = n.id
|
||||||
WHERE n.id IS NULL";
|
WHERE n.id IS NULL";
|
||||||
$total = $DB->count_records_sql("SELECT COUNT(mpn.id) " . $fromsql);
|
$total = $DB->count_records_sql("SELECT COUNT(mpn.id) " . $fromsql);
|
||||||
$i = 0;
|
if ($total > 0) {
|
||||||
$pbar = new progress_bar('deletepopupnotification', 500, true);
|
$i = 0;
|
||||||
do {
|
$pbar = new progress_bar('deletepopupnotification', 500, true);
|
||||||
if ($popupnotifications = $DB->get_records_sql("SELECT mpn.id " . $fromsql, null, 0, 1000)) {
|
do {
|
||||||
list($insql, $inparams) = $DB->get_in_or_equal(array_keys($popupnotifications));
|
if ($popupnotifications = $DB->get_records_sql("SELECT mpn.id " . $fromsql, null, 0, 1000)) {
|
||||||
$DB->delete_records_select('message_popup_notifications', "id $insql", $inparams);
|
list($insql, $inparams) = $DB->get_in_or_equal(array_keys($popupnotifications));
|
||||||
// Update progress.
|
$DB->delete_records_select('message_popup_notifications', "id $insql", $inparams);
|
||||||
$i += count($inparams);
|
// Update progress.
|
||||||
$pbar->update($i, $total, "Cleaning up orphaned popup notification records - $i/$total.");
|
$i += count($inparams);
|
||||||
}
|
$pbar->update($i, $total, "Cleaning up orphaned popup notification records - $i/$total.");
|
||||||
} while ($popupnotifications);
|
}
|
||||||
|
} while ($popupnotifications);
|
||||||
|
}
|
||||||
|
|
||||||
// Reportbuilder savepoint reached.
|
// Popup message processor savepoint reached.
|
||||||
upgrade_plugin_savepoint(true, 2020020600, 'message', 'popup');
|
upgrade_plugin_savepoint(true, 2020020600, 'message', 'popup');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue