I was working on something in Magento admin on order Management.

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.

Code in MassAction function in class Magento\Sales\Controller\Adminhtml\Order\MassUnhold

foreach ($collection->getItems() as $order) {
            if (!$order->canUnhold()) {

Code in MassAction function in class Magento\Sales\Controller\Adminhtml\Order\MassHold

foreach ($collection->getItems() as $order) {
            if (!$order->canHold()) {

Why there are two different approaches for a similar functionality?

1 Answer 1


My money is on "The mass unhold was not refactored yet".
THe order management interface has the methods hold and unHold that work the same way.
They retrieve the order object, call the hold / unhold method then use the repository to save the object.
Just for the fun of it, you can replace the code in the "unhold" mass action with the code from the "hold" mass action (changing hold to unhold obviously) and see if you get the same result.

  • I have checked after making the code for Unhold mass action similar to the hold mass action and it is working fine as expected. Apr 10, 2018 at 9:42
  • So, can we conclude that "The mass unhold was not refactored yet"? Apr 10, 2018 at 9:42
  • I cannot confirm this. It's just a speculation.
    – Marius
    Apr 10, 2018 at 10:39

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.