FACT-Finder-Web-Components / shopware5-plugin

FACT-Finder® Web Components for Shopware 5
Other
1 stars 1 forks source link

Plugin Update Failure on server #54

Closed sascharolfsen closed 3 years ago

sascharolfsen commented 3 years ago

https://github.com/FACT-Finder-Web-Components/shopware5-plugin/blob/75a9e86ff74ab3c2a97b7f73d6d8fb89bea6ee8c/Subscriber/TemplateRegistration.php#L7

Hello, after updating the current Plugin to Release 1.0.2 the above line destroys the Shopware 5 instance on our stage server. The use of the ArrayCollection must start with an \ and should look like this use \Doctrine\Common\Collections\ArrayCollection;

Shopware Version: 5.5.6 FactFinder Plugin: 1.0.2

a-laurowski commented 3 years ago

Hi @sascharolfsen Can i ask you tell me why exactly this class has to prefixed with \ on use statement? Is there any error thrown, a trace of which you can share with me? According to PHP documentation

Note that for namespaced names (fully qualified namespace names containing namespace separator, such as Foo\Bar as opposed to global names that do not, such as FooBar), the leading backslash is unnecessary and not recommended, as import names must be fully qualified, and are not processed relative to the current namespace.

I searched the codebase of Shopware of the version you use, and they import ArrayCollection the same way as we did in our module. https://github.com/shopware/shopware/blob/v5.5.6/engine/Library/Enlight/Event/EventManager.php#L25 https://github.com/shopware/shopware/blob/v5.5.6/engine/Shopware/Components/Plugin/ResourceSubscriber.php#L27 https://github.com/shopware/shopware/blob/v5.5.6/engine/Shopware/Bundle/MediaBundle/MediaServiceFactory.php#L27

We followed the SwagPaymentPayPalUnified which looks as a mature product and there, the ArrayCollection is imported in a same way: https://github.com/shopwareLabs/SwagPaymentPayPalUnified/blob/master/Subscriber/Frontend.php#L11

By the way: If you are going to update the plugin, please use the latest 1.0.3. It contains new version of FACT-Finder Web Components and one fix to similar products element located on the product page.

sascharolfsen commented 3 years ago

Hi @a-laurowski we have updated to 1.0.3 and the error still exists. We can confirm that the described import of the ArrayCollection is not the reason for the error. At first, we thought that the error was coming from it.

We update the Plugin with the Plugin Manager in the Shopware Backend and getting this error when trying to compile Theme and Cache:

Während der Bearbeitung von Shop "€ German" ist ein Fehler aufgetreten: You have requested a non-existent service "shop". Did you mean one of these: "acris_one_shop2_c_s.account_subscriber", "acris_one_shop2_c_s.filesystem.private", "acris_one_shop2_c_s.filesystem.public", "acris_one_shop2_c_s.password_hash_service", "acris_one_shop2_c_s.resources_subscriber", "acris_one_shop2_c_s.routing_shop_service", "acris_one_shop2_c_s.session_key_service", "acris_one_shop2_c_s.shop_group_service", 
...
"shopware_searchdbal.condition_handlers", "shopware_searchdbal.sorting_handlers", "shopware_searchdbal.facet_handlers", "shop"?

"€ German" is our main shop within Shopware.

If we make another change to https://github.com/FACT-Finder-Web-Components/shopware5-plugin/blob/75a9e86ff74ab3c2a97b7f73d6d8fb89bea6ee8c/Subscriber/TemplateRegistration.php#L54 and comment the line out so that the JS didn't get collected the error is gone.

Unfortunately we cannot be more specific. Best regards

a-laurowski commented 3 years ago

Hi @sascharolfsen i was searching for other way of including the js files. Unfortunately returning simple array in onCollectJavascript was causing an error during compiling theme.

But the js files should be loaded automatically when put in location Resources/frontend/js.