Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Custom Resource class parameter is not set for Grid usage #52

Open
diimpp opened this issue Feb 1, 2019 · 2 comments
Open

Custom Resource class parameter is not set for Grid usage #52

diimpp opened this issue Feb 1, 2019 · 2 comments

Comments

@diimpp
Copy link
Member

diimpp commented Feb 1, 2019

Sylius version affected: 1.3.*

Description
When new custom Resource is created via DI configuration of its Bundle or Plugin, %acme.model.feature.class% parameter is set as expected and can be seen via container:debug command, but then this parameter can't be used with Grid component.

 You have requested a non-existent parameter "acme.model.feature.class". 
 sylius_grid:
     grids:
         acme_admin_feature:
             driver:
                 name: doctrine/orm
                 options:
                     #class: "%acme.model.feature.class%" ### DOESNT WORK
                     class: "Acme\\Bundle\\FeatureBundle\\Entity\\Feature" ### WORKS

Sometimes there is also issue with repository class, which isn't set to custom repository class.

So far I've debuged it into some Grid internals, where nor class, nor repository class were set, when they should have been.

I've this issue across three different projects, all of them are Sylius 1.3+.

@pamil pamil transferred this issue from Sylius/Sylius Apr 7, 2020
@cdarken
Copy link

cdarken commented Nov 11, 2021

Same behavior here. But I see that some grids from Sylius, for instance ShopBundle, use parameters like %sylius.model.product.class%.

@mbabker
Copy link
Contributor

mbabker commented Mar 17, 2022

What order are the bundles loaded in in your application? IIRC, the resource bundle has to be loaded before the grid bundle for all of the resource related parameters to work right.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants