View Issue Details

IDProjectCategoryView StatusLast Update
0007301OXID eShop (all versions)4.07. Source code, Testpublic2022-11-09 16:57
Reportermichael_keiluweit 
PrioritynormalSeverityminorReproducibilityalways
Status resolvedResolutionfixed 
Product Version6.4.1 
Target VersionFixed in VersionNext Major Version 
Summary0007301: It's not possible to import services.yaml files within a module
DescriptionWhile one single services.yaml file in the root directory of a module is working fine, having multiple services.yaml in subdirectories isn't working.
The Symfony DI Container offers a feature to import services.yaml files into another services.yaml. Please see the documentation of Symfony for reference: https://symfony.com/doc/current/service_container/import.html#importing-configuration-with-imports

Also the importing functionality is used in the Framework directory of the shop: https://github.com/OXID-eSales/oxideshop_ce/blob/master/source/Internal/Framework/services.yaml.

Steps To ReproduceInstall this example module: https://github.com/oxid-support/b_import_services/tree/main/oxs/event
After installing, you should get a maintenance mode screen once you try to log in into the administration area. If not, just save any object (an article for example).
Additional InformationOXID Logger.ERROR: Call to a member function getCurrentShopId() on null ["[object] (Error(code: 0): Call to a member function getCurrentShopId() on null at /var/www/oxideshop/vendor/oxid-esales/oxideshop-ce/source/Internal/Framework/Event/ShopAwareServiceTrait.php:59)\n[stacktrace]\n#0 /var/www/oxideshop/vendor/oxid-esales/oxideshop-ce/source/Internal/Framework/Event/ShopAwareEventDispatcher.php(32): OxidEsales\\EshopCommunity\\Internal\\Framework\\Event\\AbstractShopAwareEventSubscriber->isActive()\n#1 /var/www/oxideshop/vendor/symfony/event-dispatcher/EventDispatcher.php(44): OxidEsales\\EshopCommunity\\Internal\\Framework\\Event\\ShopAwareEventDispatcher->doDispatch(Array, 'OxidEsales\\\\Esho...', Object(OxidEsales\\EshopCommunity\\Internal\\Transition\\ShopEvents\\AfterModelUpdateEvent))\n#2 /var/www/oxideshop/vendor/oxid-esales/oxideshop-ce/source/Core/Base.php(215): Symfony\\Component\\EventDispatcher\\EventDispatcher->dispatch('OxidEsales\\\\Esho...', Object(OxidEsales\\EshopCommunity\\Internal\\Transition\\ShopEvents\\AfterModelUpdateEvent))\n#3 /var/www/oxideshop/vendor/oxid-esales/oxideshop-ce/source/Application/Model/Article.php(2493): OxidEsales\\EshopCommunity\\Core\\Base->dispatchEvent(Object(OxidEsales\\EshopCommunity\\Internal\\Transition\\ShopEvents\\AfterModelUpdateEvent))\n#4 /var/www/oxideshop/vendor/oxid-esales/oxideshop-ee/Application/Model/Article.php(246): OxidEsales\\EshopCommunity\\Application\\Model\\Article->onChange(3, '531b537118f5f4d...', '')\n#5 /var/www/oxideshop/vendor/oxid-esales/oxideshop-ce/source/Core/Model/BaseModel.php(895): OxidEsales\\EshopEnterprise\\Application\\Model\\Article->onChange(3)\n#6 /var/www/oxideshop/vendor/oxid-esales/oxideshop-ce/source/Application/Model/Article.php(2319): OxidEsales\\EshopCommunity\\Core\\Model\\BaseModel->save()\n#7 /var/www/oxideshop/vendor/oxid-esales/oxideshop-ce/source/Application/Controller/Admin/ArticleExtend.php(150): OxidEsales\\EshopCommunity\\Application\\Model\\Article->save()\n#8 /var/www/oxideshop/vendor/oxid-esales/oxideshop-ce/source/Core/Controller/BaseController.php(534): OxidEsales\\EshopCommunity\\Application\\Controller\\Admin\\ArticleExtend->save()\n#9 /var/www/oxideshop/vendor/oxid-esales/oxideshop-ee/Core/Controller/BaseController.php(64): OxidEsales\\EshopCommunity\\Core\\Controller\\BaseController->executeFunction('save')\n#10 /var/www/oxideshop/vendor/oxid-esales/oxideshop-ce/source/Core/ShopControl.php(347): OxidEsales\\EshopEnterprise\\Core\\Controller\\BaseController->executeFunction('save')\n#11 /var/www/oxideshop/vendor/oxid-esales/oxideshop-ce/source/Core/ShopControl.php(280): OxidEsales\\EshopCommunity\\Core\\ShopControl->executeAction(Object(OxidEsales\\Eshop\\Application\\Controller\\Admin\\ArticleExtend), 'save')\n#12 /var/www/oxideshop/vendor/oxid-esales/oxideshop-ce/source/Core/ShopControl.php(142): OxidEsales\\EshopCommunity\\Core\\ShopControl->_process('OxidEsales\\\\Esho...', 'save', NULL, NULL)\n#13 /var/www/oxideshop/vendor/oxid-esales/oxideshop-ce/source/Core/Oxid.php(27): OxidEsales\\EshopCommunity\\Core\\ShopControl->start()\n#14 /var/www/oxideshop/source/index.php(16): OxidEsales\\EshopCommunity\\Core\\Oxid::run()\n#15 /var/www/oxideshop/source/admin/index.php(12): require_once('/var/www/oxides...')\n#16 {main}\n"] []
TagsDI, Module
ThemeNot defined
BrowserNot defined
PHP VersionNot defined
Database VersionNot defined

Relationships

related to 0007365 resolvedigor.iegupov Shop aware console command breaks if SymfonyS DI container creates the cache file 

Activities

indianer3c

2022-10-12 15:34

reporter   ~0014503

I get the same error message when I add new console command via custom module in services.yaml afterwards.

I am using OXID eShop Community Edition version 6.5.0 with PHP version 8.0.

I noticed that after the software deployment, the console commands no longer work via vendor/bin/oe-console.

My analysis showed that the generation of the container_cache.php file was incomplete. The entry $instance->setActiveShops([...]); is missing for the service of the console command.

If I reactivate the module via the shop admin, then the console commands work again. This is annoying and represents an additional effort.

I hope my comments can help to fix the error. A timely fix would be desirable.