PrestaShopCorp / ps_eventbus

PS EventBus is the CloudSync companion which paves the way for cloud synchronization
https://prestashop.fr/built-for-prestashop/
Open Software License 3.0
6 stars 7 forks source link

PHP fatal error after upgrade module 2.2.0 -> 3.0.12 #304

Closed ComonSoft closed 3 months ago

ComonSoft commented 4 months ago

PHP v7.2 PS v1.7.6.4 Module v3.0.12

After updating the ps_eventbus module, I got the following error on some actions like chronopost label generation (strange?!). This is the only change on the shop, that works w/o any error before update. After disabled the module chronopost works normally.

PHP Fatal error: Uncaught TypeError: Argument 1 passed to PrestaShop\\Module\\PsEventbus\\Repository\\EventbusSyncRepository::__construct() must be an instance of Context, instance of DbPDO given, called in /var/www/www.xxxx.com/var/cache/prod/Ps_eventbusFrontContainer.php on line 885 and defined in /var/www/www.xxxx.com/modules/ps_eventbus/src/Repository/EventbusSyncRepository.php:26\nStack trace:\n#0 /var/www/www.xxxx.com/var/cache/prod/Ps_eventbusFrontContainer.php(885): PrestaShop\\Module\\PsEventbus\\Repository\\EventbusSyncRepository->__construct(Object(DbPDO), Object(Context))\n#1 /var/www/www.xxxx.com/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Container.php(306): Ps_eventbusFrontContainer->getEventbusSyncRepositoryService()\n#2 /var/www/www.xxxx.com/modules/ps_accounts/vendor/prestashop/module-lib-service-container/src/DependencyInjection/ServiceContainer.php(64): Symfony\\Component\\DependencyInjection\\Container->get('PrestaShop\\\\Modu...')\n#3 /v...\n', referer: https://www.xxxx.com/my-category/myproduct.html

jokesterfr commented 3 months ago

Thank you for your report, it seems we have a dependency injection issue here. Does DbPDO ring any particular setting on your end? Is there a custom DB class in used in your PrestaShop?

fox-john commented 3 months ago

Hello @ComonSoft ! Thank you for your report.

Can you try to clear your shop cache please ? (rm -rf /var/cache/*) This service have changed recently, and the Db class is not used by this class.