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/magento2#14086: Guest cart API ignoring cartId in url for some methods #27172

Merged
merged 3 commits into from
Mar 12, 2020

Conversation

engcom-Charlie
Copy link
Contributor

Description (*)

Now guest cart API doesn't ignore card from URL. Covered by test.

Related Pull Requests

Fixed Issues (if relevant)

  1. Guest cart API ignoring cartId in url for some methods #14086: Guest cart API ignoring cartId in url for some methods

Manual testing scenarios (*)

Please see #14086

Questions or comments

Contribution checklist (*)

  • Pull request has a meaningful description of its purpose
  • All commits are accompanied by meaningful commit messages
  • All new or changed code is covered with unit/integration tests (if applicable)
  • All automated tests passed successfully (all builds are green)

@m2-assistant
Copy link

m2-assistant bot commented Mar 5, 2020

Hi @engcom-Charlie. Thank you for your contribution
Here is some useful tips how you can test your changes using Magento test environment.
Add the comment under your pull request to deploy test or vanilla Magento instance:

  • @magento give me test instance - deploy test instance based on PR changes
  • @magento give me 2.4-develop instance - deploy vanilla Magento instance

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

@engcom-Charlie engcom-Charlie changed the title magento/magento2#26830: Guest cart API ignoring cartId in url for some methods magento/magento2#14086: Guest cart API ignoring cartId in url for some methods Mar 5, 2020
GuestCartItemRepositoryInterface $guestCartItemRepository,
CartItemInterface $cartItem
): void {
if ($cartId = $this->request->getParam('cartId')) {
Copy link
Contributor

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? :-)

@ghost ghost assigned aleron75 Mar 10, 2020
@aleron75 aleron75 added the Auto-Tests: Covered All changes in Pull Request is covered by auto-tests label Mar 10, 2020
@magento-engcom-team
Copy link
Contributor

Hi @aleron75, thank you for the review.
ENGCOM-7075 has been created to process this Pull Request

@engcom-Bravo
Copy link
Contributor

✔️ QA Passed
After switching to PR, the item was successfully added to cart. No %fieldName = %fieldValue errors
7075_response

@magento-engcom-team magento-engcom-team merged commit 56f5a32 into magento:2.4-develop Mar 12, 2020
@m2-assistant
Copy link

m2-assistant bot commented Mar 12, 2020

Hi @engcom-Charlie, thank you for your contribution!
Please, complete Contribution Survey, it will take less than a minute.
Your feedback will help us to improve contribution process.

@sdzhepa sdzhepa mentioned this pull request May 9, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants