From aff0f017d087895df753fd086f98592937746d70 Mon Sep 17 00:00:00 2001 From: Ryan Cramer Date: Fri, 6 Nov 2015 09:27:47 -0500 Subject: [PATCH] Attempt fix for issue #1490 with notice queued by session sometimes not getting displayed --- wire/core/Session.php | 12 +++++++++++- wire/core/admin.php | 1 + 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/wire/core/Session.php b/wire/core/Session.php index 64d3da29..10594ede 100644 --- a/wire/core/Session.php +++ b/wire/core/Session.php @@ -114,7 +114,7 @@ public function __construct() { list($text, $flags) = $item; parent::$type($text, $flags); } - $this->remove($type); + // $this->remove($type); } $this->setTrackChanges(true); @@ -749,4 +749,14 @@ public function getHistory() { return $value; } + /** + * Remove queued notices + * + */ + public function removeNotices() { + foreach(array('message', 'error', 'warning') as $type) { + $this->remove($type); + } + } + } diff --git a/wire/core/admin.php b/wire/core/admin.php index a0e7b073..4b677a3e 100644 --- a/wire/core/admin.php +++ b/wire/core/admin.php @@ -146,5 +146,6 @@ function _checkForHttpHostError($config) { } else { if(!strlen($content)) $content = '

' . __('The process returned no content.') . '

'; require($config->paths->adminTemplates . 'default.php'); + $session->removeNotices(); }