From 3372aa3ed4c023112b71be664c1ccad564c05419 Mon Sep 17 00:00:00 2001 From: Thomas Steur Date: Tue, 24 Feb 2015 14:37:20 +1300 Subject: refs #7274 If session is writable do not remove or add a notification Please do not directly merge. First I want to understand which notification it wants to trigger in Goals overview. Haven't tested it! --- core/Notification/Manager.php | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'core/Notification') diff --git a/core/Notification/Manager.php b/core/Notification/Manager.php index 921dc3fb82..d356289876 100644 --- a/core/Notification/Manager.php +++ b/core/Notification/Manager.php @@ -9,6 +9,7 @@ namespace Piwik\Notification; use Piwik\Notification; +use Piwik\Session; use Piwik\Session\SessionNamespace; /** @@ -103,6 +104,10 @@ class Manager private static function addNotification($id, Notification $notification) { + if (!Session::isWritable()) { + return; + } + $session = static::getSession(); $session->notifications[$id] = $notification; } @@ -116,6 +121,10 @@ class Manager private static function removeNotification($id) { + if (!Session::isWritable()) { + return; + } + $session = static::getSession(); if (array_key_exists($id, $session->notifications)) { unset($session->notifications[$id]); -- cgit v1.2.3