-
Notifications
You must be signed in to change notification settings - Fork 9.4k
magento/magento2#14086: Guest cart API ignoring cartId in url for some methods #27172
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/magento2#14086: Guest cart API ignoring cartId in url for some methods #27172
Conversation
Hi @engcom-Charlie. Thank you for your contribution
For more details, please, review the Magento Contributor Guide documentation. |
GuestCartItemRepositoryInterface $guestCartItemRepository, | ||
CartItemInterface $cartItem | ||
): void { | ||
if ($cartId = $this->request->getParam('cartId')) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hello @engcom-Charlie, I also used to implement assignments within comparisons but one day someone pointed me out that it can be a bit misleading: is the =
a real assignment or a bug, that is, a missing ==
?
Reading the code without too much attention (it happens) it may seem a bug, someone could be tempted to correct it causing indeed a bug :)
At that point, I stopped using it and switched back to assigning the variable and doing the comparison in two different statements.
Would you consider doing that change, thus joining my group of old, wise, and defensive programmers like me? :-)
Hi @aleron75, thank you for the review. |
Hi @engcom-Charlie, thank you for your contribution! |
Description (*)
Now guest cart API doesn't ignore card from URL. Covered by test.
Related Pull Requests
Fixed Issues (if relevant)
Manual testing scenarios (*)
Please see #14086
Questions or comments
Contribution checklist (*)