-
Notifications
You must be signed in to change notification settings - Fork 203
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
EZP-27290: Remove abstract on DebugTemplate to fix dumping logs in profiler #1957
Conversation
@lolautruche review ping |
It turns out this is not related to eZ Legacy exclusivelly. The error basically occurs with any deprecation message that happens during rendering of a Twig template. |
would it make sense to fix it upstream ? Trying to instanciate abstracts doesn't sound right. |
Well, as far as I know, |
is this feature (us extending it to add inline debug in html) needed anymore btw? doesn't Twig or TwigBundle by now have a similar out of the box feature? |
@andrerom I'm not aware of it. Can you provide more details? |
no :) |
So, what can we do here? Going in, or shall we look for other solutions? |
AFAIK Twig doesn't provide the same thing out of the box. So I'm +1 to merge this in |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
but no delimiters like we provide (maybe we should propose it).
could do that in for instance 3.4 if they would be interested in such a feature. The buffering might be a problem, but maybe not.
@andrerom Need an issue? |
@emodric yes please |
@andrerom Done! |
@bdunogier ? (the failure is unrelated, afaik it should be fixed if @emodric rebases) |
@andrerom Rebased. |
So, going in? :) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
In my opinion, this should go into 6.7 (LTS). Any objection ? |
@bdunogier I don't see why not, but 6.9 kernel is the first one that supports Symfony 3.x anyway, so maybe no need? |
It was added to 6.7 in f3b9c53 |
Starting with symfony/symfony@eddecbd and in combination with legacy eZ templates, when an exception happens (even a silenced deprecation notice, which is converted to an exception) while rendering the template, one gets a message
Cannot instantiate abstract class eZ\Bundle\EzPublishDebugBundle\Twig\DebugTemplate
in the log, which ultimately breaks the profiler.The issue comes from https://github.com/symfony/symfony/blob/master/src/Symfony/Component/VarDumper/Caster/ExceptionCaster.php#L201-L202, which presumes that every subclass of
Twig_Template
is instantiable.Haven't found other way to solve this other than this. The fix is also compatible with Twig 2.0 (for when we enable it again in the repo).