Existing Bundles Issue after Migration from 6.9.6 to 10x #12178
Replies: 3 comments 2 replies
-
@ARY112 Hey, either use FQCN service name and inject it using DI or include the service using |
Beta Was this translation helpful? Give feedback.
-
@ARY112 , can you please suggest how you followed? i added in composer.json file => "SAMLBundle": "src/SAMLBundle",,
also added in kernel.php file as if (class_exists('\SAMLBundle\SAMLBundle')) { is this correct way? after adding these all, i cant see this bundle when running bin/console assets:install Also migration were successfull, but in the admin interface i get this error. Can anyone help me to solve this issue, tried many things but no luck |
Beta Was this translation helpful? Give feedback.
-
Its fixed |
Beta Was this translation helpful? Give feedback.
-
Till Pimcore 6.9.6, Bundles were getting registered via composer update and respective bundle services were working.
Composer.json
"autoload": {
"psr-4": {
"": ["src/"],
Bundles
Folder Structure for Bundles and all file names as per Dependency Injection:
src==>AdvancedObjectSearchBundle with NameSpace AdvancedObjectSearchBundle
src==>DropdownLoadBundle with NameSpace DropdownLoadBundle
src==>ImageAssetsBundle with NameSpace ImageAssetsBundle
Extension.php Example
"AdvancedObjectSearchBundle\AdvancedObjectSearchBundle" => TRUE,
"DropdownLoadBundle\DropdownLoadBundle" => TRUE,
"ImageAssetsBundle\ImageAssetsBundle" => TRUE,
For Pimcore 10x, Bundles are not getting registered.
Composer.json ()
"autoload": {
"psr-4": {
"App": ["src/"], This is mandatory as per documentaion.
We tried to add App in extension before Bundle Name and same inside before the namespace of all classes of Bundle otherwise composer gives error then Bundles got registered and enabled.Folder structure is same. It might be breaking name convention needed by Dependency Injection.
Extension.php after changes
"App\AdvancedObjectSearchBundle\AdvancedObjectSearchBundle" => TRUE,
"App\DropdownLoadBundle\DropdownLoadBundle" => TRUE,
"App\ImageAssetsBundle\ImageAssetsBundle" => TRUE,
Example for Namespace after changes
namespace App\AdvancedObjectSearchBundle;
We are facing issue in Services now.
Not able to use the services from bundle in pimcore 10.Getting below error message
Service "app.product_header_service" not found: even though it exists in the app's container, the container inside "App\VendorCustomImportBundle\Controller\VendorImportController" is a smaller service locator that only knows about the "Pimcore\Http\Request\Resolver\DocumentResolver", "Pimcore\Http\Request\Resolver\EditmodeResolver", "Pimcore\Http\Request\Resolver\ResponseHeaderResolver", "Pimcore\Templating\Renderer\EditableRenderer", "doctrine", "form.factory", "http_kernel", "message_bus", "messenger.default_bus", "parameter_bag", "pimcore.templating", "request_stack", "router", "security.authorization_checker", "security.csrf.token_manager", "security.token_storage", "serializer", "session" and "twig" services. Try using dependency injection instead.
Server threw exception - could not perform action. Please reload the admin interface and try again.
Entry in Services.Yaml
app.product_header_service:
class: 'App\VendorCustomImportBundle\Services\ProductHeader'
tags: ['container.ProductHeader']
arguments:
public: true
Kindly suggest what are we missing here. Is it the right way to do it.
Beta Was this translation helpful? Give feedback.
All reactions