OroPlatform Forums

Covering OroPlatform topics, including community updates and company announcements.

Forums OroPlatform Oro datagrids: query_builder as data-source > unable to register service

This topic contains 3 replies, has 2 voices, and was last updated by  Frank 3 months, 3 weeks ago.

  • Creator
    Topic
  • #39960

    Frank
    Participant

    Hi there,

    I am trying to use query_builder-approach to ‘feed’ my datagrid with data according to the docs:
    https://github.com/oroinc/platform/blob/master/src/Oro/Bundle/DataGridBundle/Resources/doc/backend/datagrid.md

    However, I am unable to register the necessary service:

    An exception has been thrown during the rendering of a template (“You have requested a non-existent service “oro_user.repository”.”) in OroUIBundle:actions:index.html.twig at line 50.

    my datagrids.yml

    (OroUserBundle/Repository/UserRepository::findEnabledUserQB)

    my services.yml

    I assume, arguments are not fitting. Or should I tag the service in some way?

    What I am doing wrong?

    Thanks
    Frank

Viewing 3 replies - 1 through 3 (of 3 total)
  • Author
    Replies
  • #39962
    Andrey Yatsenko
    Andrey Yatsenko
    Moderator

    No need to tag the service, but if you want to expose the repository as a service, you have to define the factory instead:
    See an example: https://github.com/oroinc/platform/blob/master/src/Oro/Bundle/CronBundle/Resources/config/services.yml#L75-L81

    #39964

    Frank
    Participant

    Hi Andrey,

    first I rejoiced, but … Oro still does not recoginse the service. I tried the following versions, using factory-attribute:

    None of them is working …

    Thank you for help!

    Kind regards
    Frank

    #39984

    Frank
    Participant

    Hi Oro-team,

    could you have a look on my unresolved problem concerning exposing repository as a service above, please. Would ber very kind. Thank you.

    Frank.

Viewing 3 replies - 1 through 3 (of 3 total)

You must be logged in to reply to this topic.

You will be redirected to [title]. Would you like to continue?

Yes No