Skip to content

Commit 963ff74

Browse files
committed
#14633 make the changes backward compatible
1 parent 27ae51e commit 963ff74

File tree

3 files changed

+18
-15
lines changed

3 files changed

+18
-15
lines changed

app/code/Magento/Sales/Block/Adminhtml/Order/View/Tab/Creditmemos.php

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
*/
66
namespace Magento\Sales\Block\Adminhtml\Order\View\Tab;
77

8+
use Magento\Framework\App\ObjectManager;
89
use Magento\Framework\AuthorizationInterface;
910
use Magento\Framework\View\Element\Context;
1011

@@ -26,18 +27,18 @@ class Creditmemos extends \Magento\Framework\View\Element\Text\ListText implemen
2627
* Creditmemos constructor.
2728
*
2829
* @param Context $context
29-
* @param AuthorizationInterface $authorization
3030
* @param array $data
31+
* @param AuthorizationInterface|null $authorization
3132
*/
3233
public function __construct(
3334
Context $context,
34-
AuthorizationInterface $authorization,
35-
array $data = []
35+
array $data = [],
36+
?AuthorizationInterface $authorization = null
3637
) {
37-
$this->authorization = $authorization;
38+
$this->authorization = $authorization ?? ObjectManager::getInstance()->get(AuthorizationInterface::class);
3839
parent::__construct($context, $data);
3940
}
40-
41+
4142
/**
4243
* {@inheritdoc}
4344
*/

app/code/Magento/Sales/Block/Adminhtml/Order/View/Tab/Invoices.php

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
*/
66
namespace Magento\Sales\Block\Adminhtml\Order\View\Tab;
77

8+
use Magento\Framework\App\ObjectManager;
89
use Magento\Framework\AuthorizationInterface;
910
use Magento\Framework\View\Element\Context;
1011

@@ -26,18 +27,18 @@ class Invoices extends \Magento\Framework\View\Element\Text\ListText implements
2627
* Invoices constructor.
2728
*
2829
* @param Context $context
29-
* @param AuthorizationInterface $authorization
3030
* @param array $data
31+
* @param AuthorizationInterface|null $authorization
3132
*/
3233
public function __construct(
3334
Context $context,
34-
AuthorizationInterface $authorization,
35-
array $data = []
35+
array $data = [],
36+
?AuthorizationInterface $authorization = null
3637
) {
37-
$this->authorization = $authorization;
38+
$this->authorization = $authorization ?? ObjectManager::getInstance()->get(AuthorizationInterface::class);
3839
parent::__construct($context, $data);
3940
}
40-
41+
4142
/**
4243
* {@inheritdoc}
4344
*/

app/code/Magento/Sales/Block/Adminhtml/Order/View/Tab/Shipments.php

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
*/
66
namespace Magento\Sales\Block\Adminhtml\Order\View\Tab;
77

8+
use Magento\Framework\App\ObjectManager;
89
use Magento\Framework\AuthorizationInterface;
910

1011
/**
@@ -27,23 +28,23 @@ class Shipments extends \Magento\Framework\View\Element\Text\ListText implements
2728
* @var AuthorizationInterface
2829
*/
2930
private $authorization;
30-
31+
3132
/**
3233
* Collection factory
3334
*
3435
* @param \Magento\Framework\View\Element\Context $context
3536
* @param \Magento\Framework\Registry $coreRegistry
36-
* @param AuthorizationInterface $authorization
3737
* @param array $data
38+
* @param AuthorizationInterface|null $authorization
3839
*/
3940
public function __construct(
4041
\Magento\Framework\View\Element\Context $context,
4142
\Magento\Framework\Registry $coreRegistry,
42-
AuthorizationInterface $authorization,
43-
array $data = []
43+
array $data = [],
44+
?AuthorizationInterface $authorization = null
4445
) {
4546
$this->_coreRegistry = $coreRegistry;
46-
$this->authorization = $authorization;
47+
$this->authorization = $authorization ?? ObjectManager::getInstance()->get(AuthorizationInterface::class);
4748
parent::__construct($context, $data);
4849
}
4950

0 commit comments

Comments
 (0)