From 7022b8d9e4244fb1f2fdce99f5d3f59ce13f7dd2 Mon Sep 17 00:00:00 2001 From: Mark Nelson Date: Tue, 20 Feb 2018 14:12:20 +0800 Subject: [PATCH] MDL-61255 core_message: add notification when data not migrated --- lang/en/message.php | 1 + message/index.php | 8 ++++++++ 2 files changed, 9 insertions(+) diff --git a/lang/en/message.php b/lang/en/message.php index a97ebbb5ccf..220477b479a 100644 --- a/lang/en/message.php +++ b/lang/en/message.php @@ -71,6 +71,7 @@ $string['messagepreferences'] = 'Message preferences'; $string['message'] = 'Message'; $string['messagepreferences'] = 'Message preferences'; $string['messages'] = 'Messages'; +$string['messagingdatahasnotbeenmigrated'] = 'Your messages are temporarily unavailable due to upgrades in the messaging infrastructure. Please wait for them to be migrated.'; $string['messagingdisabled'] = 'Messaging is disabled on this site, emails will be sent instead'; $string['newonlymsg'] = 'Show only new'; $string['newmessage'] = 'New message'; diff --git a/message/index.php b/message/index.php index b90a8ea2bf7..ac33533b8b0 100644 --- a/message/index.php +++ b/message/index.php @@ -147,6 +147,14 @@ $messagearea = new \core_message\output\messagearea\message_area($user1->id, $us // Now the page contents. echo $OUTPUT->header(); echo $OUTPUT->heading(get_string('messages', 'message')); + +// Display a message if the messages have not been migrated yet. +if (!get_user_preferences('core_message_migrate_data', false, $user1id)) { + $notify = new \core\output\notification(get_string('messagingdatahasnotbeenmigrated', 'message'), + \core\output\notification::NOTIFY_WARNING); + echo $OUTPUT->render($notify); +} + // Display a message that the user is viewing someone else's messages. if (!$currentuser) { $notify = new \core\output\notification(get_string('viewinganotherusersmessagearea', 'message'),