Skip to content

Magento/QuoteGraphQl/Model/Cart/GetCartForUser function updateCartCurrency #34199

Closed
@carloricci84

Description

@carloricci84

In https://github.com/magento/magento2/blob/2.4.3-release/app/code/Magento/QuoteGraphQl/Model/Cart/GetCartForUser.php

The function updateCartCurrency set an object instead of a string inside the cart object. On line 130, 131 and 133. The argument passed should be

$newStore->getCurrentCurrency()->getCode()

instead of

$newStore->getCurrentCurrency()

Preconditions (*)

  1. Magento 2.4.3

Steps to reproduce (*)

  1. Add an item to cart trough graphql with a logged in user
  2. Change your store view
  3. Try to load a quote with \Magento\Checkout\Model\Session ->getQuote in a checkout_cart_save_after events

Expected result (*)

  1. Quote is loaded correctly observer can process by doing what it needs to do

Actual result (*)

  1. Quote is not loaded because it try to compare an object with a string on line 267 of https://github.com/magento/magento2/blob/2.4.3-release/app/code/Magento/Checkout/Model/Session.php. Then when trying to save the quote on line 269 it goes on an infinite loop with the observer .

Please provide Severity assessment for the Issue as Reporter. This information will help during Confirmation and Issue triage processes.

  • Severity: S1 - Affects critical data or functionality and forces users to employ a workaround.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Area: FrameworkIssue: needs updateAdditional information is require, waiting for responsePriority: P1Once P0 defects have been fixed, a defect having this priority is the next candidate for fixing.Progress: doneProject: GraphQLReported on 2.4.3Indicates original Magento version for the Issue report.Reproduced on 2.4.xThe issue has been reproduced on latest 2.4-develop branch

    Type

    No type

    Projects

    Status

    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions