Refactor Mass Order Cancel code to use Interface#14630
Merged
magento-engcom-team merged 3 commits intomagento:2.3-developfrom Apr 14, 2018
Merged
Refactor Mass Order Cancel code to use Interface#14630magento-engcom-team merged 3 commits intomagento:2.3-developfrom
magento-engcom-team merged 3 commits intomagento:2.3-developfrom
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
requested changes
Apr 11, 2018
Contributor
sidolov
left a comment
There was a problem hiding this comment.
@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) |
Contributor
There was a problem hiding this comment.
Please, add new dependencies according to our Backward Compatible Development Guide
| /** | ||
| * @var OrderManagementInterface | ||
| */ | ||
| protected $orderManagement; |
Contributor
There was a problem hiding this comment.
Please, make this property private
Added backward compatibility for the new orderManagementInterface dependency and made the variable $orderManagement private.
Contributor
|
Hi @AnshuMishra17 , I fixed test failures |
sidolov
approved these changes
Apr 12, 2018
Contributor
|
@AnshuMishra17 thank you for contributing. Please accept Community Contributors team invitation here to gain extended permissions for this repository. |
Contributor
|
Hi @AnshuMishra17. Thank you for your contribution. |
Jeroenll
pushed a commit
to Jeroenll/magento2
that referenced
this pull request
Oct 4, 2018
…#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
4 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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