From 23de6f3a2d351da44d08e1c8369a764711928126 Mon Sep 17 00:00:00 2001 From: Mark Nelson Date: Tue, 10 Apr 2018 16:26:01 +0800 Subject: [PATCH] MDL-61255 core_message: add warning when notifications not migrated --- lang/en/message.php | 1 + message/output/popup/notifications.php | 8 ++++++++ 2 files changed, 9 insertions(+) diff --git a/lang/en/message.php b/lang/en/message.php index 220477b479a..a33f24dfe8f 100644 --- a/lang/en/message.php +++ b/lang/en/message.php @@ -84,6 +84,7 @@ $string['nomessagesfound'] = 'No messages were found'; $string['noreply'] = 'Do not reply to this message'; $string['noncontacts'] = 'Non-contacts'; $string['nonotifications'] = 'You have no notifications'; +$string['notificationdatahasnotbeenmigrated'] = 'Your notifications are temporarily unavailable due to upgrades in the notification infrastructure. Please wait for them to be migrated.'; $string['notificationwindow'] = 'Notification window'; $string['notificationpreferences'] = 'Notification preferences'; $string['notificationimage'] = 'Notification image'; diff --git a/message/output/popup/notifications.php b/message/output/popup/notifications.php index 2f0bc2581fd..a33ffe62937 100644 --- a/message/output/popup/notifications.php +++ b/message/output/popup/notifications.php @@ -65,6 +65,14 @@ $context = [ echo $OUTPUT->header(); echo $OUTPUT->heading(get_string('notifications', 'message')); + +// Display a message if the notifications have not been migrated yet. +if (!get_user_preferences('core_message_migrate_data', false, $userid)) { + $notify = new \core\output\notification(get_string('notificationdatahasnotbeenmigrated', 'message'), + \core\output\notification::NOTIFY_WARNING); + echo $OUTPUT->render($notify); +} + echo $renderer->render_from_template('message_popup/notification_area', $context); echo $OUTPUT->footer();