-
Notifications
You must be signed in to change notification settings - Fork 9.4k
Refactor Mass Order Cancel code to use Interface #14630
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
Refactor Mass Order Cancel code to use Interface #14630
Conversation
I have observed that MassAction Cancel is using the collection for orders cancel, whereas Order Cancel (order cancel from order edit section) is using Interface to put the order on hold. So, I have refactor the Mass Order Cancel code to use Sales Order Interface.
sidolov
left a comment
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.
@AnshuMishra17 , please, fix all issue according to review and take a look to failed tests
| * @param OrderManagementInterface $orderManagement | ||
| */ | ||
| public function __construct(Context $context, Filter $filter, CollectionFactory $collectionFactory) | ||
| public function __construct(Context $context, Filter $filter, CollectionFactory $collectionFactory, OrderManagementInterface $orderManagement) |
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, add new dependencies according to our Backward Compatible Development Guide
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.
Done
| /** | ||
| * @var OrderManagementInterface | ||
| */ | ||
| protected $orderManagement; |
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, make this property private
Added backward compatibility for the new orderManagementInterface dependency and made the variable $orderManagement private.
|
Hi @AnshuMishra17 , I fixed test failures |
|
@AnshuMishra17 thank you for contributing. Please accept Community Contributors team invitation here to gain extended permissions for this repository. |
|
Hi @AnshuMishra17. Thank you for your contribution. |
…#14630 - Merge Pull Request magento#14630 from AnshuMishra17/magento2:patch-2 - Merged commits: 1. dab8c38 2. 97f5978 3. 2b4ca2e # Conflicts: # app/code/Magento/Sales/Controller/Adminhtml/Order/MassCancel.php # app/code/Magento/Sales/Test/Unit/Controller/Adminhtml/Order/MassCancelTest.php
Description
I have observed that MassAction Cancel is using the collection for orders cancel, whereas Order Cancel (order cancel from order edit section) is using Interface to put the order on hold.
So, I have refactor the Mass Order Cancel code to use Sales Order Interface.
Manual testing scenarios