omines / datatables-bundle

DataTables bundle for Symfony
https://omines.github.io/datatables-bundle/
MIT License
261 stars 114 forks source link

Error with opcache preloading on php 8.1 #288

Closed Chris53897 closed 1 year ago

Chris53897 commented 1 year ago

Does someone else have problem with opcache preloading? Php 8.1.13 (with https://symfony.com/doc/current/performance.html#configure-opcache-for-maximum-performance)

`{"message":"Uncaught PHP Exception TypeError: \"Omines\DataTablesBundle\Adapter\Doctrine\ORMAdapter::normalizeProcessor(): Return value must be of type

Omines\DataTablesBundle\Adapter\Doctrine\ORM\QueryBuilderProcessorInterface, Omines\DataTablesBundle\Adapter\Doctrine\ORM\QueryBuilderProcessorInterface@anonymous

returned\" at /var/www/oops/builds/20230103-134422/vendor/omines/datatables-bundle/src/Adapter/Doctrine/ORMAdapter.php line 319","context":{"exception":{"class":"TypeError","message":"Omines\DataTablesBundle\Adapter\Doctrine\ORMAdapter::normalizeProcessor(): Return value must be of type Omines\DataTablesBundle\Adapter\Doctrine\ORM\QueryBuilderProcessorInterface, Omines\DataTablesBundle\Adapter\Doctrine\ORM\QueryBuilderProcessorInterface@anonymous returned","code":0,"file":"/var/www/oops/builds/20230103-134422/vendor/omines/datatables-bundle/src/Adapter/Doctrine/ORMAdapter.php:319"}},`

curry684 commented 1 year ago

This seems to be an issue with opcache. The error states that an anonymous implementation of QueryBuilderProcessorInterface is not a valid implementation of QueryBuilderProcessorInterface, which is nonsensical. However, I can imagine anonymous classes are tricky to preload as they only exist at runtime, and they have spawned a bunch of problems:

https://github.com/php/php-src/issues/10131 https://bugs.php.net/bug.php?id=79349 https://www.drupal.org/project/drupal/issues/3258987

As this is not something we can fix in the bundle I'm closing the issue.