Skip to content

Commit

Permalink
Merge branch 'MDL-56679-master' of git://github.com/junpataleta/moodle
Browse files Browse the repository at this point in the history
  • Loading branch information
dmonllao committed Feb 20, 2017
2 parents 49b8fa7 + 2a00bd1 commit 6c6492a
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions lib/classes/notification.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/

use stdClass;

defined('MOODLE_INTERNAL') || die();

class notification {
Expand Down Expand Up @@ -82,6 +84,10 @@ public static function add($message, $level = null) {
// Add the notification directly to the session.
// This will either be fetched in the header, or by JS in the footer.
if (!isset($SESSION->notifications) || !array($SESSION->notifications)) {
// Initialise $SESSION if necessary.
if (!is_object($SESSION)) {
$SESSION = new stdClass();
}
$SESSION->notifications = [];
}
$SESSION->notifications[] = (object) array(
Expand Down

0 comments on commit 6c6492a

Please sign in to comment.