nette/application

Flash sessions - deprecated getter

Lumeriol opened this issue · 0 comments

Version: 4.0-dev

Bug Description

In Nette\Application there are direct access to flash message session via magic __get() and __set() methods, that are deprecated in Nette\Http\SessinSection and it throws User deprecated exception.

Steps To Reproduce

Show any flash message with custom message.

Possible Solution

Change this lines of code:

vendor\nette\application\src\Application\UI\Control.php :: method flashMessage()

$messages = $this->getPresenter()->getFlashSession()->$id;
// should be
$messages = $this->getPresenter()->getFlashSession()->get($id);

$this->getPresenter()->getFlashSession()->$id = $messages;
// should be
$this->getPresenter()->getFlashSession()->set($id, $messages);

vendor\nette\application\src\Bridges\ApplicationLatte\TemplateFactory.php :: method createTemplate()

? (array) $presenter->getFlashSession()->{$control->getParameterId('flash')}
// should be
? (array) $presenter->getFlashSession()->get($control->getParameterId('flash'))