From d70c6c12bbda2b3e8e9430a64677051ad6924937 Mon Sep 17 00:00:00 2001 From: Fernando Herrero Date: Sat, 15 Dec 2018 23:43:58 +0100 Subject: [PATCH] $this->request deprecated in CakePHP 3.7.0 --- src/View/Helper/FlashHelper.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/View/Helper/FlashHelper.php b/src/View/Helper/FlashHelper.php index b58f94f..5ce6870 100644 --- a/src/View/Helper/FlashHelper.php +++ b/src/View/Helper/FlashHelper.php @@ -33,11 +33,11 @@ class FlashHelper extends \Cake\View\Helper\FlashHelper { * {@inheritDoc} */ public function render($key = 'flash', array $options = []) { - if (!$this->request->getSession()->check("Flash.$key")) { + if (!$this->getView()->getRequest()->getSession()->check("Flash.$key")) { return; } - $flash = $this->request->getSession()->read("Flash.$key"); + $flash = $this->getView()->getRequest()->getSession()->read("Flash.$key"); if (!is_array($flash)) { throw new \UnexpectedValueException(sprintf( 'Value for flash setting key "%s" must be an array.', @@ -49,7 +49,7 @@ public function render($key = 'flash', array $options = []) { $message['element'] = 'Bootstrap.'.$message['element']; } } - $this->request->getSession()->write("Flash.$key", $flash); + $this->getView()->getRequest()->getSession()->write("Flash.$key", $flash); return parent::render($key, $options); }