-
Notifications
You must be signed in to change notification settings - Fork 9.4k
Refactor Code for Mass Order Unhold #14629
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 Code for Mass Order Unhold #14629
Conversation
I have observed that MassAction Unhold is using the collection to release order from hold, whereas MassAction Hold is using Interface to put the order on hold. So, I have refactor code in app/code/Magento/Sales/Controller/Adminhtml/Order/MassUnhold.php same as in app/code/Magento/Sales/Controller/Adminhtml/Order/MassHold.php
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
/** | ||
* @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
*/ | ||
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.
I have added backward compatibility.
Added backward compatibility for the new orderManagementInterface dependency and made the variable $orderManagement private.
Hi @AnshuMishra17 , I fixed test failures |
Hi @AnshuMishra17. Thank you for your contribution. |
Description
I have observed that MassAction Unhold is using the collection to release order from hold, whereas MassAction Hold is using Interface to put the order on hold.
So, I have refactor code in app/code/Magento/Sales/Controller/Adminhtml/Order/MassUnhold.php same as in app/code/Magento/Sales/Controller/Adminhtml/Order/MassHold.php
Manual testing scenarios