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..

Hello guys. Again a problem. Now I can't add product to the cart. I updated module `spryker-shop/car

U0145CP9Q6Q
U0145CP9Q6Q Posts: 123 πŸ§‘πŸ»β€πŸš€ - Cadet

Hello guys. Again a problem. Now I can't add product to the cart. I updated module spryker-shop/cart-page (3.16.0 => 3.18.2) and I see that you've changed the \SprykerShop\Yves\CartPage\Controller\CartController::addAction functionality.
You've added this lines

$form = $this->getFactory()->createCartPageFormFactory()->getAddToCartForm()->handleRequest($request);

if (!$form->isSubmitted() || !$form->isValid()) {
    $this->addErrorMessage(static::MESSAGE_FORM_CSRF_VALIDATION_ERROR);

    return $this->redirectResponseInternal(CartControllerProvider::ROUTE_CART);
}

When in goes to \Symfony\Component\Form\Extension\HttpFoundation\HttpFoundationRequestHandler::handleRequest it checks if the form name add_to_cart_form is present in \Symfony\Component\HttpFoundation\InputBag::$parameters property. But it doesn't. Therefore method \Symfony\Component\Form\Form::isSubmitted always returns false and it shows error message.
Am I doing smth wrong? Or is it a bug again?

Comments

  • Valerii Trots
    Valerii Trots SRE @ Spryker Sprykee Posts: 1,654 ✨ - Novice

    There are project level changes in between these versions.
    Does this look like the solution?

  • U0145CP9Q6Q
    U0145CP9Q6Q Posts: 123 πŸ§‘πŸ»β€πŸš€ - Cadet

    no. still the same error

  • Valerii Trots
    Valerii Trots SRE @ Spryker Sprykee Posts: 1,654 ✨ - Novice

    So should I just update mentioned module in the current b2b demoshop to reproduce the problem?

  • U0145CP9Q6Q
    U0145CP9Q6Q Posts: 123 πŸ§‘πŸ»β€πŸš€ - Cadet
    edited June 2020

    I even don't have the last three widgets from your screenshot. I mean that were added before the new widgets. Line 246 -248

  • U0145CP9Q6Q
    U0145CP9Q6Q Posts: 123 πŸ§‘πŸ»β€πŸš€ - Cadet

    yes. i did just composer update

  • Valerii Trots
    Valerii Trots SRE @ Spryker Sprykee Posts: 1,654 ✨ - Novice

    Ok, checking.

  • U0145CP9Q6Q
    U0145CP9Q6Q Posts: 123 πŸ§‘πŸ»β€πŸš€ - Cadet

    thanks

  • Valerii Trots
    Valerii Trots SRE @ Spryker Sprykee Posts: 1,654 ✨ - Novice

    The error is something like form.csrf.error..., right?

  • U0145CP9Q6Q
    U0145CP9Q6Q Posts: 123 πŸ§‘πŸ»β€πŸš€ - Cadet

    yes yes

  • Valerii Trots
    Valerii Trots SRE @ Spryker Sprykee Posts: 1,654 ✨ - Novice
    edited June 2020

    Seems like it needs investigation. Will create a support and internal ticket in your favor.