Sylius / ShopApiPlugin

Shop API for Sylius.
https://sylius.com
129 stars 89 forks source link

Web profiler error (CoreBundle depends on ShopBundle) #677

Closed arjanfrans closed 3 years ago

arjanfrans commented 4 years ago

The web profiler breaks after I replaced the ShopBundle with the ShopApiBundle.

There are no registered paths for namespace "SyliusShop" in @SyliusCore/Collector/cart.html.twig at line 5.

It seems that the CoreBundle depends on a template from the ShopBundle.

mamazu commented 4 years ago

At least for the error templates yes.

arjanfrans commented 4 years ago

As a workaround I manually configured the ShopBundle namespace in the twig config:

twig:
    paths:
        '%kernel.project_dir%/templates': ~
        '%kernel.project_dir%/vendor/sylius/sylius/src/Sylius/Bundle/ShopBundle/Resources/views': 'SyliusShop'
mamazu commented 4 years ago

And the define your own templates?

arjanfrans commented 4 years ago

No, I didn't define my own templates. Symfony doesn't automatically fin the SyliusShop twig namespace, because the ShopBundle is not active. However, it is still installed as a part of the core installation. So I just manually configure the namespace here.

mamazu commented 4 years ago

Ah okay then I will add this to the documentation as a step during installation.

arjanfrans commented 4 years ago

@mamazu Thanks!

The better solution would be to fix this in the core bundle, I created an issue there. See https://github.com/Sylius/Sylius/issues/11918

mamazu commented 4 years ago

Thanks for your help.

lchrusciel commented 4 years ago

Hey Arjan,

thanks for reporting. We should fix it in the core library 👍

lchrusciel commented 4 years ago

Fixed already in #11958. Will be published with the next patch release