What are the Slack Archives?

It’s a history of our time together in the Slack Community! There’s a ton of knowledge in here, so feel free to search through the archives for a possible answer to your question.

Because this space is not active, you won’t be able to create a new post or comment here. If you have a question or want to start a discussion about something, head over to our categories and pick one to post in! You can always refer back to a post from Slack Archives if needed; just copy the link to use it as a reference..

Hi, maybe anyone knows what to do? The HttpApplicationPlugin is already registered in ApplicationDep

UK7KBE2JW
UK7KBE2JW Posts: 463 🧑🏻‍🚀 - Cadet

Comments

  • UKEP86J66
    UKEP86J66 Posts: 208 🧑🏻‍🚀 - Cadet

    It makes sense that the console application does not have a request stack - it’s command line only. It looks like this is all out-of-the-box code so probably worth raising a bug ticket.

  • UK7KBE2JW
    UK7KBE2JW Posts: 463 🧑🏻‍🚀 - Cadet

    yeah, the klarna integration needs the request stack in console since it will be loaded there. Thx for feedback. I will open bug ticket and drop the klarna integration for the project, since its not used. maybe a better way would be to extract the methods in plugins and load only the needed one

  • fsmeier
    fsmeier Senior Software Engineer & Developer Enablement Advocate Sprykee Posts: 1,051 ⚖️ - Guardians (admin)
    edited August 2022

    hey, i had exactly the same problem when i integrated it.

    I fixed it with this code snippet in PayoneDependencyProvider:

    protected function addRequestStack(Container $container): Container
        {
            $container->set(static::SERVICE_REQUEST_STACK, function (Container $container) {
                return $container->hasApplicationService(static::SERVICE_REQUEST_STACK)
                    ? $container->getApplicationService(static::SERVICE_REQUEST_STACK)
                    : new RequestStack();
            });
    
            return $container;
        }
    
  • fsmeier
    fsmeier Senior Software Engineer & Developer Enablement Advocate Sprykee Posts: 1,051 ⚖️ - Guardians (admin)

    It is also reported at Spryker already as subissue of another task

  • UK7KBE2JW
    UK7KBE2JW Posts: 463 🧑🏻‍🚀 - Cadet

    For us I have added the HttpApplicationPlugin to ConsoleDependencyProvider in getApplicationPlugins method. So it should work for every console command where the http_stack is required.