Skip to content

Commit 72e7f57

Browse files
committed
MAGETWO-39186: Error if change order id in order view url
1 parent 854801d commit 72e7f57

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

app/code/Magento/Sales/Controller/AbstractController/OrderLoader.php

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
use Magento\Framework\App\RequestInterface;
1010
use Magento\Framework\Registry;
1111
use Magento\Framework\Controller\Result\ForwardFactory;
12+
use Magento\Framework\Controller\Result\RedirectFactory;
1213

1314
class OrderLoader implements OrderLoaderInterface
1415
{
@@ -37,6 +38,11 @@ class OrderLoader implements OrderLoaderInterface
3738
*/
3839
protected $resultForwardFactory;
3940

41+
/**
42+
* @var RedirectFactory
43+
*/
44+
protected $redirectFactory;
45+
4046
/**
4147
* @param \Magento\Sales\Model\OrderFactory $orderFactory
4248
* @param OrderViewAuthorizationInterface $orderAuthorization
@@ -49,13 +55,15 @@ public function __construct(
4955
OrderViewAuthorizationInterface $orderAuthorization,
5056
Registry $registry,
5157
\Magento\Framework\UrlInterface $url,
52-
ForwardFactory $resultForwardFactory
58+
ForwardFactory $resultForwardFactory,
59+
RedirectFactory $redirectFactory
5360
) {
5461
$this->orderFactory = $orderFactory;
5562
$this->orderAuthorization = $orderAuthorization;
5663
$this->registry = $registry;
5764
$this->url = $url;
5865
$this->resultForwardFactory = $resultForwardFactory;
66+
$this->redirectFactory = $redirectFactory;
5967
}
6068

6169
/**
@@ -78,7 +86,7 @@ public function load(RequestInterface $request)
7886
return true;
7987
}
8088
/** @var \Magento\Framework\Controller\Result\Redirect $resultRedirect */
81-
$resultRedirect = $this->resultRedirectFactory->create();
89+
$resultRedirect = $this->redirectFactory->create();
8290
return $resultRedirect->setUrl($this->url->getUrl('*/*/history'));
8391
}
8492
}

0 commit comments

Comments
 (0)