Skip to content
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

Exception, when attempting to EXPLAIN a query from Web Profiler #707

Closed
aik099 opened this issue Oct 2, 2017 · 1 comment
Closed

Exception, when attempting to EXPLAIN a query from Web Profiler #707

aik099 opened this issue Oct 2, 2017 · 1 comment

Comments

@aik099
Copy link

aik099 commented Oct 2, 2017

Using Product entity from https://symfony.com/doc/current/doctrine.html documentation and modified DefaultController::editAction to:

  1. accept Product $product parameter
  2. have @Route("/edit-product/{product}") annotation

Then I'm accessing /edit-product/2 url and viewing performed DB queries in Web Profiler.

When I click on Explain query link I'm getting An error occurred while loading the query explanation. message instead of actual EXPLAIN and Developer Console of Browser shows that underlying AJAX request failed with HTTP 500 response.

Looking deeper shows that error was:

An exception has been thrown during the rendering of a template ("You have requested a non-existent service "templating". Did you mean one of these: "templating.helper.logout_url", "templating.helper.security"?"). (500 Internal Server Error)

2017-10-02_1114

The https://github.com/doctrine/DoctrineBundle/blob/master/Controller/ProfilerController.php#L82 code is using templating service without checking if it exists upfront. It should be doing check like in ControllerTrailt::render method (see https://github.com/symfony/symfony/blob/master/src/Symfony/Bundle/FrameworkBundle/Controller/ControllerTrait.php#L231-L247) instead.

P.S.
I've used Symfony Flex to create a project and templates are rendered correctly with Twig.

@ArrowStrike
Copy link

ArrowStrike commented Mar 14, 2018

We have the same problem in "doctrine/doctrine-bundle": "^1.6".
And this guy fix it perfectly
https://github.com/ssaki/DoctrineBundle/commit/8e91477358a3814c7b3c979e645adc88014c6ed2
using Symfony\Component\VarDumper\Cloner\Data;
Please, can you add this to doctrine?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants