Commit 57a02fee authored by Robert Lyon's avatar Robert Lyon Committed by Rebecca Blundell

Bug 1733722: Render session messages before calling templates

Problem on PHP 7.1 where messages were not being cleared

behatnotneeded

Change-Id: Ie6365c98b665a9b7271a9c748e4934e468ffa75f
Signed-off-by: Robert Lyon's avatarRobert Lyon <robertl@catalyst.net.nz>
parent f33fe8d9
......@@ -544,7 +544,8 @@ class Session {
*/
function insert_messages($placement='messages') {
global $SESSION;
return $SESSION->render_messages($placement);
$messages = $SESSION->render_messages($placement);
return (array($placement => $messages));
}
......
......@@ -915,6 +915,8 @@ EOF;
require_once('cookieconsent.php');
$smarty->assign('COOKIECONSENTCODE', get_cookieconsent_code());
}
// Render the session messages
$smarty->assign('messages', insert_messages('messages'));
return $smarty;
}
......
......@@ -118,7 +118,7 @@
</div>
{/if}
{dynamic}{insert_messages}{/dynamic}
{dynamic}{$messages.messages|safe}{/dynamic}
{if $institutionselector}
<div class="institutionselector">
{$institutionselector|safe}
......
......@@ -9,7 +9,7 @@
</h3>
<div class="panel-body">
<noscript><p>{str tag="javascriptnotenabled"}</p></noscript>
{dynamic}{insert_messages placement='loginbox'}{/dynamic}
{dynamic}{$messages.loginbox|safe}{/dynamic}
<div id="loginform_container">
{$login_form|safe}
</div>
......
......@@ -5,7 +5,7 @@
</h3>
<div class="panel-body">
<noscript><p>{str tag="javascriptnotenabled"}</p></noscript>
{dynamic}{insert_messages placement='loginbox'}{/dynamic}
{dynamic}{$messages.loginbox}{/dynamic}
<div id="loginform_container">{$sbdata.loginform|safe}</div>
</div>
</div>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment