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

Fixes fatal error if query params is a data dumper object instead of array #758

Closed
wants to merge 2 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 4 additions & 1 deletion Controller/ProfilerController.php
Expand Up @@ -8,6 +8,7 @@
use Symfony\Component\DependencyInjection\ContainerAwareInterface;
use Symfony\Component\DependencyInjection\ContainerInterface;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\VarDumper\Cloner\Data;

/**
* ProfilerController.
Expand Down Expand Up @@ -88,7 +89,9 @@ private function explainSQLServerPlatform(Connection $connection, $query)

private function explainOtherPlatform(Connection $connection, $query)
{
return $connection->executeQuery('EXPLAIN '.$query['sql'], $query['params'], $query['types'])
$params = $query['params'] instanceof Data ? $query['params']->getValue(true) : $query['params'];
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is Data? There is no import for this class and Doctrine\Bundle\DoctrineBundle\Controller\Data doesn't exist either - probably missing import?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've missed to add the import. It's done now


return $connection->executeQuery('EXPLAIN '.$query['sql'], $params, $query['types'])
->fetchAll(\PDO::FETCH_ASSOC);
}
}