Skip to content

Conversation

@AnshuMishra17
Copy link
Contributor

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

  1. Go to Sales Order Grid
  2. Select any number of orders to cancel
  3. Select Cancel from Action Dropdown

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 sidolov self-assigned this Apr 11, 2018
Copy link
Contributor

@sidolov sidolov left a 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)
Copy link
Contributor

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

Copy link
Contributor Author

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;
Copy link
Contributor

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

AnshuMishra17 and others added 2 commits April 11, 2018 15:00
Added backward compatibility for the new orderManagementInterface dependency and made the variable $orderManagement private.
@sidolov
Copy link
Contributor

sidolov commented Apr 12, 2018

Hi @AnshuMishra17 , I fixed test failures

@magento-engcom-team
Copy link
Contributor

@AnshuMishra17 thank you for contributing. Please accept Community Contributors team invitation here to gain extended permissions for this repository.

@magento-engcom-team
Copy link
Contributor

Hi @AnshuMishra17. Thank you for your contribution.
Changes from your Pull Request will be available with the upcoming 2.3.0 release.

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants