Sylius/SyliusGridBundle

GridBundle creates new instances of repositories

Closed this issue · 4 comments

Sylius version affected: 1.x

Description
We have some properties set to object repository which is used later. The problem occurs using GridBundle since it creates new instance of repository and all properties are reset.

https://github.com/Sylius/Sylius/blob/2760de2a3cba93bfdab12dbef28af2b5480400b2/src/Sylius/Bundle/GridBundle/Doctrine/ORM/Driver.php#L47

Steps to reproduce

  • set some configuration values for repository via DependencyInjection
  • try to use them while building query with GridBundle

Possible Solution

For instance when using OrderRepository, the following place should call sylius.repository.order instead of creating new instance:
https://github.com/Sylius/Sylius/blob/2760de2a3cba93bfdab12dbef28af2b5480400b2/src/Sylius/Bundle/GridBundle/Doctrine/ORM/Driver.php#L49

stale commented

This issue has been automatically marked as stale because it has not had any recent activity. It will be closed in a week if no further activity occurs. Thank you for your contributions.

Activity.

pamil commented

This would be fixed with Sylius/SyliusResourceBundle#220 and released in ResourceBundle v1.7.0 soon.

Should be fixed already