OroPlatform Forums

Covering OroPlatform topics, including community updates and company announcements.

Forums Forums OroPlatform ExtendedBundle/register customservice: You have requested a non-existent service

This topic contains 1 reply, has 1 voice, and was last updated by  Frank 4 years, 9 months ago.

Starting from March 1, 2020 the forum has been switched to the read-only mode. Please head to StackOverflow for support.

  • Creator
    Topic
  • #40020

    Frank
    Participant

    Hi there,

    I want to extend some service-class:
    Oro\Bundle\ShoppingListBundle\Manager\CurrentShoppingListManager.php

    So, I have done the following steps:

    1. created/registered extended bundle: MyShoppingListBundle
    2. extended some controller, calling there the custom container-service
    ‘my_shopping_list.manager.current_buo_shopping_list’

    3. created custom service class:
    MyShoppingListBundle\Manager\CurrentBuoShoppingListManager.php
    (remaining it empty for testing, it should be work identical to Oro-CurrentShoppingListManager.php)

    4. Registered the container-service for step 2., creating
    MyShoppingListBundle/Resources/config/services.yml

    After clearing dev-cache, and performing the addToShopping-List button-click ,
    the ajax-called Url throws an exception:

    You have requested a non-existent service “my_shopping_list.manager.current_buo_shopping_list”.
    Did you mean one of these: “oro_shopping_list.manager.current_shopping_list”,
    “oro_shopping_list.manager.guest_shopping_list”, “oro_shopping_list.manager.shopping_list”?

    Searching the oro-docs I found:
    https://oroinc.com/orocrm/doc/2.6/architecture/customization#symfony-replace-services

    So, I tagged the service:

    Result was the same:

    You have requested a non-existent service “my_shopping_list.manager.current_buo_shopping_list”.
    Did you mean one of these: “oro_shopping_list.manager.current_shopping_list”,
    “oro_shopping_list.manager.guest_shopping_list”, “oro_shopping_list.manager.shopping_list”?

    What I am doing wrong?

    More documentation, or ome use case would be great.

    Many thanks for help.
    Frank

Viewing 1 replies (of 1 total)
  • Author
    Replies
  • #40022

    Frank
    Participant

    Clarified it to myself:

    1. I forgot to announce the services.xml in
    MyShoppingListBundle/DependencyInjection/MyShoppingListExtension.php

    2. Overring the service-label-path in services.xml is enough :

    And, it works as expected.

    Thanks to Mike Kudelya:
    https://forum.oroinc.com/oro-platform/topic/how-to-override-parts-of-oro

Viewing 1 replies (of 1 total)

The forum ‘OroPlatform’ is closed to new topics and replies.

Back to top