MDL-62678 core: Improve efficiency of notifications and avoid ajax call
This commit is contained in:
@@ -58,7 +58,8 @@ class notification {
|
||||
public static function add($message, $level = null) {
|
||||
global $PAGE, $SESSION;
|
||||
|
||||
if ($PAGE && $PAGE->state === \moodle_page::STATE_IN_BODY) {
|
||||
if ($PAGE && ($PAGE->state === \moodle_page::STATE_IN_BODY
|
||||
|| $PAGE->state === \moodle_page::STATE_DONE)) {
|
||||
// Currently in the page body - just render and exit immediately.
|
||||
// We insert some code to immediately insert this into the user-notifications created by the header.
|
||||
$id = uniqid();
|
||||
|
||||
Reference in New Issue
Block a user