mirror of
https://github.com/moodle/moodle.git
synced 2025-08-05 08:56:36 +02:00
MDL-70042 message_popup: progress bar on upgrade only when necessary
This commit is contained in:
parent
99680d1be4
commit
fad0a943b2
1 changed files with 13 additions and 11 deletions
|
@ -51,6 +51,7 @@ 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);
|
||||||
|
if ($total > 0) {
|
||||||
$i = 0;
|
$i = 0;
|
||||||
$pbar = new progress_bar('deletepopupnotification', 500, true);
|
$pbar = new progress_bar('deletepopupnotification', 500, true);
|
||||||
do {
|
do {
|
||||||
|
@ -62,6 +63,7 @@ function xmldb_message_popup_upgrade($oldversion) {
|
||||||
$pbar->update($i, $total, "Cleaning up orphaned popup notification records - $i/$total.");
|
$pbar->update($i, $total, "Cleaning up orphaned popup notification records - $i/$total.");
|
||||||
}
|
}
|
||||||
} while ($popupnotifications);
|
} while ($popupnotifications);
|
||||||
|
}
|
||||||
|
|
||||||
// Reportbuilder savepoint reached.
|
// Reportbuilder 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