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

Inconsistent quote item isVirtual value #34089

Closed
1 of 5 tasks
MeCapron opened this issue Sep 15, 2021 · 12 comments
Closed
1 of 5 tasks

Inconsistent quote item isVirtual value #34089

MeCapron opened this issue Sep 15, 2021 · 12 comments
Assignees
Labels
Area: Framework Component: Framework/App Issue: Confirmed Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed Priority: P4 No current plan to fix. Fixing can be deferred as a logical part of more important work. Progress: dev in progress Reported on 2.4.2 Indicates original Magento version for the Issue report. Reproduced on 2.4.x The issue has been reproduced on latest 2.4-develop branch Triage: Dev.Experience Issue related to Developer Experience and needs help with Triage to Confirm or Reject it

Comments

@MeCapron
Copy link
Contributor

MeCapron commented Sep 15, 2021

Preconditions (*)

  1. Magento 2.4.2 (but on all versions)

Steps to reproduce (*)

  1. Have a quote of 2 items
  2. Save only ONE specific product
  3. Look at isVirtual value from the 2 products, the saved quote item will have a boolean value, the other one will have a string ('1'/'0') value

Expected result (*)

  1. Quote items should have the same value in all cases

Actual result (*)

  1. Look at isVirtual value from the 2 products, the saved will have a boolean value, the other one will have a string ('1'/'0') value

This inconsistent behavior is done by the beforeSave function of \Magento\Quote\Model\Item line 274

I couldn't find why this line was introduced because it is present since the very first commit (2014). A simple workaround would be to replace

$this->setIsVirtual($this->getProduct()->getIsVirtual()); to $this->setIsVirtual($this->getProduct()->getIsVirtual() ? '1' : '0');

However, this line does not seem to be useful at all.


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

  • Severity: S0 - Affects critical data or functionality and leaves users without workaround.
  • Severity: S1 - Affects critical data or functionality and forces users to employ a workaround.
  • Severity: S2 - Affects non-critical data or functionality and forces users to employ a workaround.
  • Severity: S3 - Affects non-critical data or functionality and does not force users to employ a workaround.
  • Severity: S4 - Affects aesthetics, professional look and feel, “quality” or “usability”.
@m2-assistant
Copy link

m2-assistant bot commented Sep 15, 2021

Hi @MeCapron. 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 Sep 16, 2021

Hi @engcom-November. 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.

Sorry, something went wrong.

@engcom-November
Copy link
Contributor

engcom-November commented Sep 22, 2021

Verified the issue on Magento 2.4-develop branch having B2B modules enabled but cannot able to reproduce the issue:

Steps performed:
Logged into frontend using Company Account
Added 2 products to cart
Clicked on Request a Quote
Commented and sent request
Verified "is_virtual" value in quote_item table - Value is 0 for both the products
Admin - Sales - Quotes - View Quote - deleted one product and Submitted - Product entry got deleted in quote_item table.
"is_virtual" value is 0 for saved product in quote_item table - No issue
Cannot able to reproduce this issue on deleting the product from admin / front end - My Quotes and resubmitting the request.
@MeCapron , can you please recheck the issue on Magento 2.4-develop having B2B enabled and elaborate the steps to reproduce if the issue is still reproducible
Kindly elaborate more details about "Save only ONE specific product" to reproduce this issue.
Thank you.

@engcom-November engcom-November added the Issue: needs update Additional information is require, waiting for response label Sep 22, 2021
@engcom-November engcom-November added the Issue: Cannot Reproduce Cannot reproduce the issue on the latest `2.4-develop` branch label Sep 22, 2021
@MeCapron
Copy link
Contributor Author

Hello @engcom-November,

thanks for your help. Sorry for not being that specific, the issue will NOT be reproduced inside the database.

It will only be reproduced inside the PHP because values will be cast when sent to database.

I don't know how to reproduce it clearly on a Vanilla instance without tweaking the files.

The problem is :

  • Access /checkout/cart URL
  • Save the quote at the very beginning of the process (like in a dispatcher/observer)
  • Dump quote item is_virtual values (should be booleans)

Do the same without saving the quote at the beginning :

  • Dump quote item is_virtual values (should be ints)

Value types is changing accross the time, on PHP specifically, because of the line mentioned in #34089 (comment)

Am I not clear enough?

Thanks!

@engcom-November engcom-November added Reported on 2.4.2 Indicates original Magento version for the Issue report. Triage: Dev.Experience Issue related to Developer Experience and needs help with Triage to Confirm or Reject it labels Sep 23, 2021
@m2-community-project m2-community-project bot removed the Issue: Cannot Reproduce Cannot reproduce the issue on the latest `2.4-develop` branch label Sep 23, 2021
@m2-assistant
Copy link

m2-assistant bot commented Sep 23, 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.

Sorry, something went wrong.

@engcom-Hotel
Copy link
Contributor

Hello @MeCapron,

Thanks for posting this issue!

I have verified this issue via codebase. As per the code, setIsVirtual method requires int type parameter. Please refer this codebase link for reference.

And getIsVirtual method is returning bool values only. Please check the link for reference.

So I am confirming this issue.

Thanks

@engcom-Hotel engcom-Hotel added Area: Framework Component: Framework/App Reproduced on 2.4.x The issue has been reproduced on latest 2.4-develop branch Issue: Confirmed Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed labels Oct 6, 2021
@m2-community-project m2-community-project bot removed the Issue: needs update Additional information is require, waiting for response label Oct 6, 2021
@github-jira-sync-bot
Copy link

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

@m2-assistant
Copy link

m2-assistant bot commented Oct 6, 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: P4 No current plan to fix. Fixing can be deferred as a logical part of more important work. label Oct 8, 2021
@artemii-karkusha
Copy link

@magento I am working on this

@ananth-iyer
Copy link
Member

@magento I am working on this

@ananth-iyer
Copy link
Member

I am not able to reproduce the issue.

@engcom-Bravo
Copy link
Contributor

@ananth-iyer Thanks for your Contribution!!.

As per this comment #34089 (comment) since the issue is no more reproducible we are closing this issue.

Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: Framework Component: Framework/App Issue: Confirmed Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed Priority: P4 No current plan to fix. Fixing can be deferred as a logical part of more important work. Progress: dev in progress Reported on 2.4.2 Indicates original Magento version for the Issue report. Reproduced on 2.4.x The issue has been reproduced on latest 2.4-develop branch Triage: Dev.Experience Issue related to Developer Experience and needs help with Triage to Confirm or Reject it
Projects
None yet
Development

No branches or pull requests

8 participants