SyliusCmsPlugin icon indicating copy to clipboard operation
SyliusCmsPlugin copied to clipboard

`BlockFixtureFactory` should not use `ChannelContext`

Open Prometee opened this issue 4 years ago • 1 comments

Fixture are usually used during a command and is considered stateless. ChannelContext is supposed to be stateful : https://github.com/Sylius/Sylius/issues/9987#issuecomment-1022977043

A Block has a product_codes and a channels nodes, if a product need to be found within a channel, then iterate through channels values to retrieve Products is a solution to avoid using the ChannelContext. If no channels is given then retrieve the Products without the Channel filter.

What do you think about that ?

Prometee avatar Jan 27 '22 10:01 Prometee

When you disable {_locale} from the url, block fixture explodes! https://docs.sylius.com/en/1.12/cookbook/shop/disabling-localised-urls.html

Running fixture "block"...  

In RequestStack.php line 126:
                                            
  There is currently no session available.  
                                            

sylius:fixtures:load [<suite>]

codebach avatar Sep 21 '23 12:09 codebach