-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
Call to a member function removeQueryCacheProfile() on null #10943
Comments
Reproduced with PHP 8 (you can drop the php 7 constraint for your reproducer). Here is the full stack trace after I add a return type to
|
I removed the |
It is also weird that the
|
Here is what it looks like with symfony 5.4 (contains non-printable chars):
The method seems to handle 2 different serialization formats, and this would be a 3rd one. |
Adding here orm/lib/Doctrine/ORM/Query/ParserResult.php Lines 142 to 148 in 858b01f
?? $data[self::class][$property] fixes the issue for me (Symfony 4.4, PHP 7.4.29, doctrine/orm 2.16.2)
|
That makes sense… would you mind contributing that? Also, I don't fully understand why this has to do with Symfony… does Symfony decide what serialization format is in use? 🤔 Cc @derrabus , I think we should either revert the addition of the method, or apply @andrew-demb's suggestion. |
I don't believe so it should alway be the same. But this location call's the When i update to Symfony
|
Inside the dumped cache file i just found this diff Symfony seemed to have fixed the dumper. Seems that this is the changed we are looking for symfony/symfony@6d8a363 or symfony/symfony@6ccb85e [
[
- 'Doctrine\\ORM\\Query\\ParserResult' => [
- 'sqlExecutor' => $o[1],
- 'resultSetMapping' => $o[2],
- ],
+ "\0".'Doctrine\\ORM\\Query\\ParserResult'."\0".'sqlExecutor' => $o[1],
+ "\0".'Doctrine\\ORM\\Query\\ParserResult'."\0".'resultSetMapping' => $o[2],
+ "\0".'Doctrine\\ORM\\Query\\ParserResult'."\0".'parameterMappings' => [],
],
] |
@cmodijk thanks for the investigation. Can you try @andrew-demb solution? If it works for you, can you please contribute it? Another "solution" would be to drop support for Symfony 4, which is in security fixes only mode, but that would leave you in a bad situation. |
I just created #10948. It would leave us in a bad situation if Symfony 4 support is dropped but we are in the process of upgrading all of our old Symfony projects. At this time we disabled the query caching to allow us to upgrade everything else. But the issue here for us is we are not sure how bug this impact is on preformance. |
Fixed by #10948 |
Bug Report
Summary
I have create a this example repository to reproduce the error. When i grap this project using PHP
7.4
and al the dependencies in it I get this error.The first call to the method tries to to connect to a database. When i ignore this and then refresh the page i get this error. It seems to happen after the cache is stored on disk and then it is tried to be reloaded.
On the same error i already found doctrine/DoctrineBundle#1654 and #10684 but this pull request does not fixes it. After debugging when i remove the
__unserialize
method fromlib/Doctrine/ORM/Query/ParserResult.php
it seems to work not sure what is going on here.Current behavior
Results in a error
How to reproduce
git clone git@github.com:JCID/removeQueryCacheProfile.git cd removeQueryCacheProfile composer install symfony serve
Expected behavior
To not have a error.
The text was updated successfully, but these errors were encountered: