Minor - Fix flash messages

pull/2542/head
jmontoyaa 7 years ago
parent b669d46410
commit 45baaf3ac9
  1. 3
      main/inc/global.inc.php
  2. 4
      main/inc/lib/display.lib.php
  3. 3
      main/inc/lib/template.lib.php
  4. 1
      src/ThemeBundle/Resources/views/Layout/layout_one_col.html.twig

@ -53,9 +53,9 @@ try {
// This 'load_legacy' variable is needed to know that symfony is loaded using old style legacy mode,
// and not called from a symfony controller from public/
$request->request->set('load_legacy', true);
$request->setBaseUrl($request->getRequestUri());
$response = $kernel->handle($request);
$container = $kernel->getContainer();
if ($kernel->isInstalled()) {
require_once $kernel->getConfigurationFile();
@ -102,7 +102,6 @@ try {
$context = $container->get('router.request_context');
$host = $router->getContext()->getHost();
$context->setBaseUrl($appendValue);
$container->set('router.request_context', $context);
$packages = $container->get('assets.packages');

@ -2375,7 +2375,7 @@ class Display
*/
public static function getFlashToString()
{
/*$messages = Session::read('flash_messages');
$messages = Session::read('flash_messages');
$messageToString = '';
if (!empty($messages)) {
foreach ($messages as $message) {
@ -2383,7 +2383,7 @@ class Display
}
}
return $messageToString;*/
return $messageToString;
}
/**

@ -391,7 +391,10 @@ class Template
*/
public function returnResponse($params, $template)
{
$flash = Display::getFlashToString();
Display::cleanFlashMessages();
$response = new Response();
$params['flash_messages'] = $flash;
$content = Container::getTemplating()->render($template, $params);
$response->setContent($content);
$response->send();

@ -46,6 +46,7 @@
{% block chamilo_messages %}
{% autoescape false %}
{{ flash_messages }}
{% include '@ChamiloTheme/FlashMessage/render.html.twig' %}
{% endautoescape %}
{% endblock %}

Loading…
Cancel
Save