-
Notifications
You must be signed in to change notification settings - Fork 9.4k
Fix php warning on update item qty request from sidebar #34953
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
Fix php warning on update item qty request from sidebar #34953
Conversation
Hi @Melnychuk-Alexandr. Thank you for your contribution
❗ Automated tests can be triggered manually with an appropriate comment:
You can find more information about the builds here ℹ️ Run only required test builds during development. Run all test builds before sending your pull request for review. For more details, review the Magento Contributor Guide documentation. 🕙 You can find the schedule on the Magento Community Calendar page. 📞 The triage of Pull Requests happens in the queue order. If you want to speed up the delivery of your contribution, 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 |
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.
Please also add test coverage for this case
@magento run all tests |
The requested builds are added to the queue. You should be able to see them here within a few minutes. Please re-request them if they don't show in a reasonable amount of time. |
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.
Hi @Melnychuk-Alexandr,
Could you please cover your change with any type of automated test?
Thank you!
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.
Could you also restrict this controller to handle only POST requests?
I see it's only used in
magento2/app/code/Magento/Checkout/view/frontend/templates/cart/form.phtml
Lines 13 to 20 in 7c6b636
<form action="<?= $block->escapeUrl($block->getUrl('checkout/cart/updatePost')) ?>" | |
method="post" | |
id="form-validate" | |
data-mage-init='{"Magento_Checkout/js/action/update-shopping-cart": | |
{"validationURL" : "<?= $block->escapeUrl($block->getUrl('checkout/cart/updateItemQty')) ?>", | |
"updateCartActionContainer": "#update_cart_action_container"} | |
}' | |
class="form form-cart"> |
@magento run Functional Tests B2B |
The requested builds are added to the queue. You should be able to see them here within a few minutes. Please re-request them if they don't show in a reasonable amount of time. |
@magento run Functional Tests B2B |
The requested builds are added to the queue. You should be able to see them here within a few minutes. Please re-request them if they don't show in a reasonable amount of time. |
@magento run Functional Tests B2B |
The requested builds are added to the queue. You should be able to see them here within a few minutes. Please re-request them if they don't show in a reasonable amount of time. |
✔️ QA Passed Preconditions:
Manual testing scenario:
Before: ✖️ We were getting an 500 error in the response After: ✔️ We are getting an Magento error with 404 There is no additional testing required since it is specific to URL tampering, hence no regression case has been added for this. |
@magento run Functional Tests B2B |
The requested builds are added to the queue. You should be able to see them here within a few minutes. Please re-request them if they don't show in a reasonable amount of time. |
Hi @Den4ik, thank you for the review. |
As PR has been approved and tested, also the build is green now, hence moving this PR to Merge in Progress. Thank you! |
Hello, Anybody know how to apply the patch for this issue? I have downloaded https://github.com/magento/magento2/commit/b692ea60a10f695cfb3114c5faf6b8dd60548b32.diff and tried with composer i.e So please help if anybody know exactly how to apply this patch. |
(Additional hint: you really should be switching from composer v1 to composer v2, it will run many many times faster.) |
@hostep thanks for your response, I took all commits of the PR and apply patch accordingdly and now patch works fine. thanks a lot. |
Description (*)
Added "int" type when get param from request.
Path to file (app/code/Magento/Checkout/Controller/Sidebar/UpdateItemQty.php)
Related Pull Requests
Fixed Issues (if relevant)
Manual testing scenarios (*)
Questions or comments
Contribution checklist (*)