Skip to content

Commit 4e4eb6b

Browse files
author
Viktor Sevch
committed
MC-35765: [2.4.0-beta1] Full Tax Details causes the Order Page to fail
1 parent 64acc51 commit 4e4eb6b

File tree

2 files changed

+10
-2
lines changed
  • app/code/Magento/Sales
    • Block/Adminhtml/Order/Totals
    • view/adminhtml/templates/order/totals

2 files changed

+10
-2
lines changed

app/code/Magento/Sales/Block/Adminhtml/Order/Totals/Tax.php

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

8+
use Magento\Framework\App\ObjectManager;
9+
use Magento\Framework\Math\Random;
10+
811
/**
912
* Adminhtml order tax totals block
1013
*
@@ -50,6 +53,7 @@ class Tax extends \Magento\Tax\Block\Sales\Order\Tax
5053
* @param \Magento\Tax\Model\Sales\Order\TaxFactory $taxOrderFactory
5154
* @param \Magento\Sales\Helper\Admin $salesAdminHelper
5255
* @param array $data
56+
* @param Random $randomHelper
5357
*/
5458
public function __construct(
5559
\Magento\Backend\Block\Template\Context $context,
@@ -58,13 +62,15 @@ public function __construct(
5862
\Magento\Tax\Model\Calculation $taxCalculation,
5963
\Magento\Tax\Model\Sales\Order\TaxFactory $taxOrderFactory,
6064
\Magento\Sales\Helper\Admin $salesAdminHelper,
61-
array $data = []
65+
array $data = [],
66+
?Random $randomHelper = null
6267
) {
6368
$this->_taxHelper = $taxHelper;
6469
$this->_taxCalculation = $taxCalculation;
6570
$this->_taxOrderFactory = $taxOrderFactory;
6671
$this->_salesAdminHelper = $salesAdminHelper;
6772
$data['taxHelper'] = $this->_taxHelper;
73+
$data['randomHelper'] = $randomHelper ?? ObjectManager::getInstance()->get(Random::class);
6874
parent::__construct($context, $taxConfig, $data);
6975
}
7076

app/code/Magento/Sales/view/adminhtml/templates/order/totals/tax.phtml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ $_fullInfo = $block->getFullTaxInfo();
1616

1717
/** @var \Magento\Tax\Helper\Data $taxHelper */
1818
$taxHelper = $block->getData('taxHelper');
19+
/** @var \Magento\Framework\Math\Random $randomHelper */
20+
$randomHelper = $block->getData('randomHelper');
1921
?>
2022

2123
<?php if ($block->displayFullSummary() && $_fullInfo): ?>
@@ -86,7 +88,7 @@ $taxHelper = $block->getData('taxHelper');
8688
$amount = $info['tax_amount'];
8789
$baseAmount = $info['base_tax_amount'];
8890
$isFirst = 1;
89-
$infoTitle = sha1($info['title']);
91+
$infoTitle = $randomHelper->getRandomString(20);
9092
?>
9193
<tr id="info-<?= /* @noEscape */ $infoTitle ?>"
9294
class="summary-details<?= ($isTop ? ' summary-details-first' : '') ?>">

0 commit comments

Comments
 (0)