-
Notifications
You must be signed in to change notification settings - Fork 9.4k
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
When canceling order with OrderService, the cancel method always saves the order and returns true, even if the order can not be canceled. #10803
Labels
Fixed in 2.2.x
The issue has been fixed in 2.2 release line
Fixed in 2.3.x
The issue has been fixed in 2.3 release line
Issue: Clear Description
Gate 2 Passed. Manual verification of the issue description passed
Issue: Confirmed
Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed
Issue: Format is valid
Gate 1 Passed. Automatic verification of issue format passed
Issue: Ready for Work
Gate 4. Acknowledged. Issue is added to backlog and ready for development
Comments
Hi @ekuusela |
@ekuusela thank you for your bug report. |
Internal ticket to track issue progress: MAGETWO-75327 |
I would like to work on this issue |
strell
added a commit
to strell/magento2
that referenced
this issue
Sep 30, 2017
From db79dbf Mon Sep 17 00:00:00 2001 From: freakphp <[email protected]> Date: Sun, 17 Sep 2017 12:52:00 +0200 Subject: [PATCH 1/2] magento#10803 update OrderService to return correct bool value for cancel method From d4cddf7 Mon Sep 17 00:00:00 2001 From: Ievgen Shakhsuvarov <[email protected]> Date: Mon, 18 Sep 2017 12:22:00 +0200 Subject: [PATCH 2/2] magento#10919: update OrderService to return correct bool value
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
Fixed in 2.2.x
The issue has been fixed in 2.2 release line
Fixed in 2.3.x
The issue has been fixed in 2.3 release line
Issue: Clear Description
Gate 2 Passed. Manual verification of the issue description passed
Issue: Confirmed
Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed
Issue: Format is valid
Gate 1 Passed. Automatic verification of issue format passed
Issue: Ready for Work
Gate 4. Acknowledged. Issue is added to backlog and ready for development
I'm assuming the cancel method in OrderService is supposed to return true only if the cancellation was a success.
magento2/app/code/Magento/Sales/Model/Service/OrderService.php
Line 87 in 5973d67
But, since the cancel method in Order always returns the order itself, the service method ends up always saving and returning true as if the order was cancelled.
magento2/app/code/Magento/Sales/Model/Order.php
Line 1112 in 5973d67
This is confusing if not broken. The meaning of the boolean return value should be documented and if it is indeed meant as an indicator of successful cancelation, the service method should be fixed.
I'll include the boilerplate below to prevent this issue from getting auto-marked as not helpful.
Preconditions
Steps to reproduce
Expected result
Actual result
The text was updated successfully, but these errors were encountered: