Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
1 task
carloricci84 opened this issue Sep 29, 2021 · 7 comments
Closed
1 task
Labels
Area: Framework Issue: needs update Additional information is require, waiting for response Priority: P1 Once P0 defects have been fixed, a defect having this priority is the next candidate for fixing. Progress: done Project: GraphQL Reported on 2.4.3 Indicates original Magento version for the Issue report. Reproduced on 2.4.x The issue has been reproduced on latest 2.4-develop branch

Comments

@carloricci84
Copy link

carloricci84 commented Sep 29, 2021

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.
@m2-assistant
Copy link

m2-assistant bot commented Sep 29, 2021

Hi @carloricci84. Thank you for your report.
To help us process this issue please make sure that you provided the following information:

  • Summary of the issue
  • Information on your environment
  • Steps to reproduce
  • Expected and actual results

Please make sure that the issue is reproducible on the vanilla Magento instance following Steps to reproduce. To deploy vanilla Magento instance on our environment, please, add a comment to the issue:

@magento give me 2.4-develop instance - upcoming 2.4.x release

For more details, please, review the Magento Contributor Assistant documentation.

Please, add a comment to assign the issue: @magento I am working on this


⚠️ According to the Magento Contribution requirements, all issues must go through the Community Contributions Triage process. Community Contributions Triage is a public meeting.

🕙 You can find the schedule on the Magento Community Calendar page.

📞 The triage of issues happens in the queue order. If you want to speed up the delivery of your contribution, please join the Community Contributions Triage session to discuss the appropriate ticket.

🎥 You can find the recording of the previous Community Contributions Triage on the Magento Youtube Channel

✏️ Feel free to post questions/proposals/feedback related to the Community Contributions Triage process to the corresponding Slack Channel

@m2-assistant
Copy link

m2-assistant bot commented Nov 11, 2021

Hi @engcom-Hotel. Thank you for working on this issue.
In order to make sure that issue has enough information and ready for development, please read and check the following instruction: 👇

  • 1. Verify that issue has all the required information. (Preconditions, Steps to reproduce, Expected result, Actual result).

    DetailsIf the issue has a valid description, the label Issue: Format is valid will be added to the issue automatically. Please, edit issue description if needed, until label Issue: Format is valid appears.

  • 2. Verify that issue has a meaningful description and provides enough information to reproduce the issue. If the report is valid, add Issue: Clear Description label to the issue by yourself.

  • 3. Add Component: XXXXX label(s) to the ticket, indicating the components it may be related to.

  • 4. Verify that the issue is reproducible on 2.4-develop branch

    Details- Add the comment @magento give me 2.4-develop instance to deploy test instance on Magento infrastructure.
    - If the issue is reproducible on 2.4-develop branch, please, add the label Reproduced on 2.4.x.
    - If the issue is not reproducible, add your comment that issue is not reproducible and close the issue and stop verification process here!

  • 5. Add label Issue: Confirmed once verification is complete.

  • 6. Make sure that automatic system confirms that report has been added to the backlog.

@engcom-Hotel
Copy link
Contributor

Hello @carloricci84,

Thanks for posting this issue!

The issue is reproducible in the Magento 2.4-develop branch by looking into codebase only. I am attaching a screenshot of the file app/code/Magento/QuoteGraphQl/Model/Cart/GetCartForUser.php below for reference:

image

setStoreCurrencyCode function requires parameter as string but object passed of type Currency.

Thanks

@engcom-Hotel engcom-Hotel added Area: Framework Issue: Confirmed Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed Reported on 2.4.3 Indicates original Magento version for the Issue report. Reproduced on 2.4.x The issue has been reproduced on latest 2.4-develop branch labels Nov 11, 2021
@m2-community-project m2-community-project bot moved this from Ready for Confirmation to Confirmed in Issue Confirmation and Triage Board Nov 11, 2021
@github-jira-sync-bot
Copy link

✅ Jira issue https://jira.corp.magento.com/browse/AC-1716 is successfully created for this GitHub issue.

@m2-assistant
Copy link

m2-assistant bot commented Nov 11, 2021

✅ Confirmed by @engcom-Hotel. Thank you for verifying the issue.
Issue Available: @engcom-Hotel, You will be automatically unassigned. Contributors/Maintainers can claim this issue to continue. To reclaim and continue work, reassign the ticket to yourself.

@engcom-Alfa engcom-Alfa added the Priority: P2 A defect with this priority could have functionality issues which are not to expectations. label Nov 16, 2021
@m2-community-project m2-community-project bot added this to Ready for Development in High Priority Backlog Nov 16, 2021
@github-jira-sync-bot github-jira-sync-bot added Priority: P1 Once P0 defects have been fixed, a defect having this priority is the next candidate for fixing. and removed Priority: P2 A defect with this priority could have functionality issues which are not to expectations. labels Mar 1, 2022
@engcom-Lima
Copy link
Contributor

Hi @carloricci84, I tried to reproduce the issue on 2.4-develop, however the issue is not reproducible.

Steps followed to reproduce the issue:-

  1. Created 2 store views
  2. Added simple product from one store view in GraphQl
  3. Changed the header to set the second store view
  4. Proceeded with Checkout

I was able to complete the checkout without any error

Please let me know if this issue is still reproducible.
If it is still reproducible then please let me know the exact steps along with code modifications (if any) I need to do.
I will reverify it.

Thanks

@engcom-Lima engcom-Lima removed the Issue: Confirmed Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed label Mar 21, 2022
@engcom-Alfa engcom-Alfa added the Issue: needs update Additional information is require, waiting for response label Mar 29, 2022
@m2-community-project m2-community-project bot moved this from Ready for Development to Pull Request In Progress in High Priority Backlog Apr 4, 2022
@m2-community-project m2-community-project bot moved this from Ready for Development to Pull Request In Progress in High Priority Backlog Apr 4, 2022
@engcom-Alfa
Copy link
Contributor

As there is no response to my last comment in last ~14 days, closing this current issue.

Kindly upgrade to the latest version to re test. In case of any Magento related issues, you may please report a new bug with all the information like Preconditions, detailed steps to reproduce, expected and actual Results along with screenshots/ screen recordings possibly.

For any Magento related references, you may refer to the Magento user guide.

@m2-community-project m2-community-project bot moved this from Pull Request In Progress to Done in High Priority Backlog Apr 5, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: Framework Issue: needs update Additional information is require, waiting for response Priority: P1 Once P0 defects have been fixed, a defect having this priority is the next candidate for fixing. Progress: done Project: GraphQL Reported on 2.4.3 Indicates original Magento version for the Issue report. Reproduced on 2.4.x The issue has been reproduced on latest 2.4-develop branch
Projects
Development

No branches or pull requests

6 participants