Skip to content

Commit 3f053dd

Browse files
🔃 [EngCom] Public Pull Requests - 2.2-develop
Accepted Public Pull Requests: - #13173: Performance: remove count() form the condition section of a loop (by @coderimus) - #13855: Invoice grid shows wrong subtotal for partial items invoice. It shows order's subtotal instead if invoiced item's subtotal (by @ankurvr) - #14030: [FIX] Remove not used and empty template (by @coderimus) - #14026: [FIX] Remove not used variable in template (by @coderimus) - #14011: Added alias to block 'product.info.description' (by @chedaroo) - #14013: Use `^1.4` for `composer/composer` (by @sandermangel) Fixed GitHub Issues: - #13804: Invoice grid shows wrong subtotal for partial items invoice. It shows order's subtotal instead if invoiced item's subtotal (reported by @ankurvr) has been fixed in #13855 by @ankurvr in 2.2-develop branch Related commits: 1. 579b074
2 parents 9c538a1 + 36e7a41 commit 3f053dd

File tree

12 files changed

+20
-19
lines changed

12 files changed

+20
-19
lines changed

app/code/Magento/Backend/Model/Widget/Grid/Parser.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,9 @@ public function parseExpression($expression)
3030
$expression = trim($expression);
3131
foreach ($this->_operations as $operation) {
3232
$splittedExpr = preg_split('/\\' . $operation . '/', $expression, -1, PREG_SPLIT_DELIM_CAPTURE);
33-
if (count($splittedExpr) > 1) {
34-
for ($i = 0; $i < count($splittedExpr); $i++) {
33+
$count = count($splittedExpr);
34+
if ($count > 1) {
35+
for ($i = 0; $i < $count; $i++) {
3536
$stack = array_merge($stack, $this->parseExpression($splittedExpr[$i]));
3637
if ($i > 0) {
3738
$stack[] = $operation;

app/code/Magento/Catalog/Model/Layer/Filter/DataProvider/Price.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -282,7 +282,8 @@ public function getMaxPrice()
282282
public function getPriorFilters($filterParams)
283283
{
284284
$priorFilters = [];
285-
for ($i = 1; $i < count($filterParams); ++$i) {
285+
$count = count($filterParams);
286+
for ($i = 1; $i < $count; ++$i) {
286287
$priorFilter = $this->validateFilter($filterParams[$i]);
287288
if ($priorFilter) {
288289
$priorFilters[] = $priorFilter;

app/code/Magento/Catalog/view/frontend/layout/catalog_product_view.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@
137137
</block>
138138
</container>
139139
<block class="Magento\Catalog\Block\Product\View\Description" name="product.info.details" template="Magento_Catalog::product/view/details.phtml" after="product.info.media">
140-
<block class="Magento\Catalog\Block\Product\View\Description" name="product.info.description" template="Magento_Catalog::product/view/attribute.phtml" group="detailed_info">
140+
<block class="Magento\Catalog\Block\Product\View\Description" name="product.info.description" as="description" template="Magento_Catalog::product/view/attribute.phtml" group="detailed_info">
141141
<arguments>
142142
<argument name="at_call" xsi:type="string">getDescription</argument>
143143
<argument name="at_code" xsi:type="string">description</argument>

app/code/Magento/Config/Test/Unit/Model/Config/Structure/Element/Dependency/MapperTest.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,8 @@ public function testGetDependenciesWhenDependentIsInvisible($isValueSatisfy)
9898
{
9999
$expected = [];
100100
$rowData = array_values($this->_testData);
101-
for ($i = 0; $i < count($this->_testData); ++$i) {
101+
$count = count($this->_testData);
102+
for ($i = 0; $i < $count; ++$i) {
102103
$data = $rowData[$i];
103104
$dependentPath = 'some path ' . $i;
104105
$field = $this->_getField(
@@ -158,7 +159,8 @@ public function testGetDependenciesIsVisible()
158159
{
159160
$expected = [];
160161
$rowData = array_values($this->_testData);
161-
for ($i = 0; $i < count($this->_testData); ++$i) {
162+
$count = count($this->_testData);
163+
for ($i = 0; $i < $count; ++$i) {
162164
$data = $rowData[$i];
163165
$field = $this->_getField(
164166
true,

app/code/Magento/Paypal/Model/Report/Settlement.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -376,7 +376,8 @@ public function parseCsv($localCsv, $format = 'new')
376376
// Section columns.
377377
// In case ever the column order is changed, we will have the items recorded properly
378378
// anyway. We have named, not numbered columns.
379-
for ($i = 1; $i < count($line); $i++) {
379+
$count = count($line);
380+
for ($i = 1; $i < $count; $i++) {
380381
$sectionColumns[$line[$i]] = $i;
381382
}
382383
$flippedSectionColumns = array_flip($sectionColumns);

app/code/Magento/Sales/etc/di.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -686,7 +686,7 @@
686686
<item name="billing_address" xsi:type="object">BillingAddressAggregator</item>
687687
<item name="shipping_address" xsi:type="object">ShippingAddressAggregator</item>
688688
<item name="shipping_information" xsi:type="string">sales_order.shipping_description</item>
689-
<item name="subtotal" xsi:type="string">sales_order.base_subtotal</item>
689+
<item name="subtotal" xsi:type="string">sales_invoice.base_subtotal</item>
690690
<item name="shipping_and_handling" xsi:type="string">sales_order.base_shipping_amount</item>
691691
<item name="base_grand_total" xsi:type="string">sales_invoice.base_grand_total</item>
692692
<item name="grand_total" xsi:type="string">sales_invoice.grand_total</item>

app/code/Magento/Tax/view/frontend/templates/checkout/discount.phtml

Lines changed: 0 additions & 5 deletions
This file was deleted.

app/code/Magento/Tax/view/frontend/templates/checkout/tax.phtml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@
3838
</tr>
3939

4040
<?php if ($this->helper('Magento\Tax\Helper\Data')->displayFullSummary() && $_value != 0): ?>
41-
<?php $isTop = 1; ?>
4241
<?php foreach ($block->getTotal()->getFullInfo() as $info): ?>
4342
<?php if (isset($info['hidden']) && $info['hidden']) {
4443
continue;
@@ -64,7 +63,6 @@
6463
<?php endif; ?>
6564
</tr>
6665
<?php $isFirst = 0; ?>
67-
<?php $isTop = 0; ?>
6866
<?php endforeach; ?>
6967
<?php endforeach; ?>
7068
<?php endif;?>

app/code/Magento/Usps/Model/Carrier.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2054,7 +2054,8 @@ protected function _parseZip($zipString, $returnFull = false)
20542054
if (preg_match('/[\\d\\w]{5}\\-[\\d\\w]{4}/', $zipString) != 0) {
20552055
$zip = explode('-', $zipString);
20562056
}
2057-
for ($i = 0; $i < count($zip); ++$i) {
2057+
$count = count($zip);
2058+
for ($i = 0; $i < $count; ++$i) {
20582059
if (strlen($zip[$i]) == 5) {
20592060
$zip5 = $zip[$i];
20602061
} elseif (strlen($zip[$i]) == 4) {

app/code/Magento/Webapi/Model/Rest/Swagger/Generator.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -749,7 +749,8 @@ private function handlePrimitive($name, $prefix)
749749
private function convertPathParams($uri)
750750
{
751751
$parts = explode('/', $uri);
752-
for ($i=0; $i < count($parts); $i++) {
752+
$count = count($parts);
753+
for ($i=0; $i < $count; $i++) {
753754
if (strpos($parts[$i], ':') === 0) {
754755
$parts[$i] = '{' . substr($parts[$i], 1) . '}';
755756
}

0 commit comments

Comments
 (0)