From ab370409fec31d4c434bbf2b4c29de4724702011 Mon Sep 17 00:00:00 2001 From: Hugo Hamon Date: Thu, 2 Apr 2015 17:40:28 +0200 Subject: [PATCH] [FrameworkBundle] fixes displaying of deprecation notices. --- .../Resources/config/debug_prod.xml | 2 +- .../views/Collector/logger.html.twig | 34 +++++++++++-------- 2 files changed, 21 insertions(+), 15 deletions(-) diff --git a/src/Symfony/Bundle/FrameworkBundle/Resources/config/debug_prod.xml b/src/Symfony/Bundle/FrameworkBundle/Resources/config/debug_prod.xml index 39266eab0363..9d70124fbe16 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Resources/config/debug_prod.xml +++ b/src/Symfony/Bundle/FrameworkBundle/Resources/config/debug_prod.xml @@ -16,7 +16,7 @@ - + null null true null diff --git a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/logger.html.twig b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/logger.html.twig index 4ab569020f5d..4ae5063064b2 100644 --- a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/logger.html.twig +++ b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/logger.html.twig @@ -88,10 +88,13 @@ {% if collector.logs %}
    - {% for log in collector.logs if priority >= 0 and log.priority >= priority or priority < 0 and log.context.type|default(0) == priority %} -
  • - {{ logger.display_message(loop.index, log) }} -
  • + {% for log in collector.logs %} + {% set is_deprecation = log.context.level is defined and log.context.type is defined and (constant('E_DEPRECATED') == log.context.type or constant('E_USER_DEPRECATED') == log.context.type) %} + {% if priority == '-100' ? is_deprecation : log.priority >= priority %} +
  • + {{ logger.display_message(loop.index, log, is_deprecation) }} +
  • + {% endif %} {% else %}
  • No logs available for this priority.
  • {% endfor %} @@ -104,15 +107,18 @@ {% endblock %} -{% macro display_message(log_index, log) %} - {% if log.context.level is defined and log.context.type is defined and (constant('E_DEPRECATED') == log.context.type or constant('E_USER_DEPRECATED') == log.context.type) %} - DEPRECATION - {{ log.message }} - {% set id = 'sf-call-stack-' ~ log_index %} - - - + - - {% for index, call in log.context.stack if index > 1 %} +{% macro display_message(log_index, log, is_deprecation) %} + {% if is_deprecation %} + {% set stack = log.context.stack|default([]) %} + + {% if stack %} + + + + + + {% endif %} + + {% for index, call in stack if index > 1 %} {% if index == 2 %} {% endif %} {% endfor %}