Skip to content

Commit 408dea2

Browse files
committed
Merge remote-tracking branch 'mainline/develop' into SPRINT-33-NORD
2 parents 31f3023 + a9f1814 commit 408dea2

File tree

54 files changed

+648
-349
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

54 files changed

+648
-349
lines changed

app/code/Magento/Catalog/Model/Factory.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@
44
* See COPYING.txt for license details.
55
*/
66

7-
// @codingStandardsIgnoreFile
8-
97
/**
108
* Model factory
119
*/

app/code/Magento/Catalog/Model/Layer/Filter/Dynamic/AlgorithmFactory.php

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@
44
* See COPYING.txt for license details.
55
*/
66

7-
// @codingStandardsIgnoreFile
8-
97
namespace Magento\Catalog\Model\Layer\Filter\Dynamic;
108

119
use Magento\Framework\App\Config\ScopeConfigInterface;
@@ -48,8 +46,11 @@ class AlgorithmFactory
4846
* @param ScopeConfigInterface $scopeConfig
4947
* @param array $algorithms
5048
*/
51-
public function __construct(ObjectManagerInterface $objectManager, ScopeConfigInterface $scopeConfig, array $algorithms)
52-
{
49+
public function __construct(
50+
ObjectManagerInterface $objectManager,
51+
ScopeConfigInterface $scopeConfig,
52+
array $algorithms
53+
) {
5354
$this->objectManager = $objectManager;
5455
$this->scopeConfig = $scopeConfig;
5556
$this->algorithms = $algorithms;
@@ -64,7 +65,10 @@ public function __construct(ObjectManagerInterface $objectManager, ScopeConfigIn
6465
*/
6566
public function create(array $data = [])
6667
{
67-
$calculationType = $this->scopeConfig->getValue(self::XML_PATH_RANGE_CALCULATION, ScopeInterface::SCOPE_STORE);
68+
$calculationType = $this->scopeConfig->getValue(
69+
self::XML_PATH_RANGE_CALCULATION,
70+
ScopeInterface::SCOPE_STORE
71+
);
6872

6973
if (!isset($this->algorithms[$calculationType])) {
7074
throw new LocalizedException(__('%1 was not found in algorithms', $calculationType));

app/code/Magento/Catalog/Model/Template/Filter/Factory.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@
44
* See COPYING.txt for license details.
55
*/
66

7-
// @codingStandardsIgnoreFile
8-
97
/**
108
* Template filter factory
119
*/

app/code/Magento/CatalogImportExport/Model/Import/Product.php

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2201,9 +2201,13 @@ private function reindexProducts($productIdsToReindex = [])
22012201
*/
22022202
public function retrieveAttributeByCode($attrCode)
22032203
{
2204+
/** @var string $attrCode */
2205+
$attrCode = mb_strtolower($attrCode);
2206+
22042207
if (!isset($this->_attributeCache[$attrCode])) {
22052208
$this->_attributeCache[$attrCode] = $this->getResource()->getAttribute($attrCode);
22062209
}
2210+
22072211
return $this->_attributeCache[$attrCode];
22082212
}
22092213

@@ -2537,6 +2541,7 @@ private function parseAttributesWithoutWrappedValues($attributesData)
25372541
continue;
25382542
}
25392543
list($code, $value) = explode(self::PAIR_NAME_VALUE_SEPARATOR, $attributeData, 2);
2544+
$code = mb_strtolower($code);
25402545
$preparedAttributes[$code] = $value;
25412546
}
25422547
return $preparedAttributes;
@@ -2563,7 +2568,7 @@ private function parseAttributesWithoutWrappedValues($attributesData)
25632568
private function parseAttributesWithWrappedValues($attributesData)
25642569
{
25652570
$attributes = [];
2566-
preg_match_all('~((?:[a-z0-9_])+)="((?:[^"]|""|"' . $this->getMultiLineSeparatorForRegexp() . '")+)"+~',
2571+
preg_match_all('~((?:[a-zA-Z0-9_])+)="((?:[^"]|""|"' . $this->getMultiLineSeparatorForRegexp() . '")+)"+~',
25672572
$attributesData,
25682573
$matches
25692574
);
@@ -2572,7 +2577,7 @@ private function parseAttributesWithWrappedValues($attributesData)
25722577
$value = 'multiselect' != $attribute->getFrontendInput()
25732578
? str_replace('""', '"', $matches[2][$i])
25742579
: '"' . $matches[2][$i] . '"';
2575-
$attributes[$attributeCode] = $value;
2580+
$attributes[mb_strtolower($attributeCode)] = $value;
25762581
}
25772582
return $attributes;
25782583
}

app/code/Magento/CatalogImportExport/Test/Unit/Model/Import/ProductTest.php

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1291,6 +1291,68 @@ public function testGetImagesFromRow($rowData, $expectedResult)
12911291
);
12921292
}
12931293

1294+
public function testParseAttributesWithoutWrappedValuesWillReturnsLowercasedAttributeCodes()
1295+
{
1296+
$attributesData = 'PARAM1=value1,param2=value2';
1297+
$preparedAttributes = $this->invokeMethod(
1298+
$this->importProduct,
1299+
'parseAttributesWithoutWrappedValues',
1300+
[$attributesData]
1301+
);
1302+
1303+
$this->assertArrayHasKey('param1', $preparedAttributes);
1304+
$this->assertEquals('value1', $preparedAttributes['param1']);
1305+
1306+
$this->assertArrayHasKey('param2', $preparedAttributes);
1307+
$this->assertEquals('value2', $preparedAttributes['param2']);
1308+
1309+
$this->assertArrayNotHasKey('PARAM1', $preparedAttributes);
1310+
}
1311+
1312+
public function testParseAttributesWithWrappedValuesWillReturnsLowercasedAttributeCodes()
1313+
{
1314+
$attribute1 = $this->getMockBuilder(\Magento\Eav\Model\Entity\Attribute\AbstractAttribute::class)
1315+
->disableOriginalConstructor()
1316+
->setMethods(['getFrontendInput'])
1317+
->getMockForAbstractClass();
1318+
1319+
$attribute1->expects($this->once())
1320+
->method('getFrontendInput')
1321+
->willReturn('text');
1322+
1323+
$attribute2 = $this->getMockBuilder(\Magento\Eav\Model\Entity\Attribute\AbstractAttribute::class)
1324+
->disableOriginalConstructor()
1325+
->setMethods(['getFrontendInput'])
1326+
->getMockForAbstractClass();
1327+
1328+
$attribute2->expects($this->once())
1329+
->method('getFrontendInput')
1330+
->willReturn('multiselect');
1331+
1332+
$attributeCache = [
1333+
'param1' => $attribute1,
1334+
'param2' => $attribute2,
1335+
];
1336+
1337+
$this->setPropertyValue($this->importProduct, '_attributeCache', $attributeCache);
1338+
1339+
$attributesData = 'PARAM1="value1",PARAM2="value2"';
1340+
$attributes = $this->invokeMethod(
1341+
$this->importProduct,
1342+
'parseAttributesWithWrappedValues',
1343+
[$attributesData]
1344+
);
1345+
1346+
$this->assertArrayHasKey('param1', $attributes);
1347+
$this->assertEquals('value1', $attributes['param1']);
1348+
1349+
$this->assertArrayHasKey('param2', $attributes);
1350+
$this->assertEquals('"value2"', $attributes['param2']);
1351+
1352+
$this->assertArrayNotHasKey('PARAM1', $attributes);
1353+
$this->assertArrayNotHasKey('PARAM2', $attributes);
1354+
}
1355+
12941356
public function getImagesFromRowDataProvider()
12951357
{
12961358
return [

app/code/Magento/Config/view/adminhtml/templates/system/config/form/field/array.phtml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ $_colspan = $block->isAddAfter() ? 2 : 1;
9393
var rowInputElementNames = Object.keys(rowData.column_values);
9494
for (var i = 0; i < rowInputElementNames.length; i++) {
9595
if ($(rowInputElementNames[i])) {
96-
$(rowInputElementNames[i]).value = rowData.column_values[rowInputElementNames[i]];
96+
$(rowInputElementNames[i]).setValue(rowData.column_values[rowInputElementNames[i]]);
9797
}
9898
}
9999
}

app/code/Magento/ConfigurableProduct/Ui/DataProvider/Product/Form/Modifier/ConfigurablePrice.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,10 @@ public function modifyMeta(array $meta)
8888
self::$advancedPricingButton => [
8989
'arguments' => [
9090
'data' => [
91-
'config' => $visibilityConfig,
91+
'config' => [
92+
'componentType' => 'container',
93+
$visibilityConfig
94+
],
9295
],
9396
],
9497
],

app/code/Magento/Customer/Model/Metadata/ElementFactory.php

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,21 @@
11
<?php
22
/**
3-
* Customer Form Element Factory
4-
*
53
* Copyright © Magento, Inc. All rights reserved.
64
* See COPYING.txt for license details.
75
*/
86

9-
// @codingStandardsIgnoreFile
10-
7+
/**
8+
* Customer Form Element Factory
9+
*/
1110
namespace Magento\Customer\Model\Metadata;
1211

1312
class ElementFactory
1413
{
1514
const OUTPUT_FORMAT_JSON = 'json';
16-
1715
const OUTPUT_FORMAT_TEXT = 'text';
18-
1916
const OUTPUT_FORMAT_HTML = 'html';
20-
2117
const OUTPUT_FORMAT_PDF = 'pdf';
22-
2318
const OUTPUT_FORMAT_ONELINE = 'oneline';
24-
2519
const OUTPUT_FORMAT_ARRAY = 'array';
2620

2721
// available only for multiply attributes
@@ -40,8 +34,10 @@ class ElementFactory
4034
* @param \Magento\Framework\ObjectManagerInterface $objectManager
4135
* @param \Magento\Framework\Stdlib\StringUtils $string
4236
*/
43-
public function __construct(\Magento\Framework\ObjectManagerInterface $objectManager, \Magento\Framework\Stdlib\StringUtils $string)
44-
{
37+
public function __construct(
38+
\Magento\Framework\ObjectManagerInterface $objectManager,
39+
\Magento\Framework\Stdlib\StringUtils $string
40+
) {
4541
$this->_objectManager = $objectManager;
4642
$this->_string = $string;
4743
}
@@ -64,7 +60,7 @@ public function create(
6460
$dataModelClass = $attribute->getDataModel();
6561
$params = [
6662
'entityTypeCode' => $entityTypeCode,
67-
'value' => is_null($value) ? false : $value,
63+
'value' => $value === null ? false : $value,
6864
'isAjax' => $isAjax,
6965
'attribute' => $attribute,
7066
];

app/code/Magento/Eav/Model/AttributeDataFactory.php

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@
44
* See COPYING.txt for license details.
55
*/
66

7-
// @codingStandardsIgnoreFile
8-
97
namespace Magento\Eav\Model;
108

119
/**
@@ -16,15 +14,10 @@
1614
class AttributeDataFactory
1715
{
1816
const OUTPUT_FORMAT_JSON = 'json';
19-
2017
const OUTPUT_FORMAT_TEXT = 'text';
21-
2218
const OUTPUT_FORMAT_HTML = 'html';
23-
2419
const OUTPUT_FORMAT_PDF = 'pdf';
25-
2620
const OUTPUT_FORMAT_ONELINE = 'oneline';
27-
2821
const OUTPUT_FORMAT_ARRAY = 'array';
2922

3023
// available only for multiply attributes

app/code/Magento/GroupedProduct/Block/Adminhtml/Items/Column/Name/Grouped.php

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@
99

1010
class Grouped extends \Magento\Sales\Block\Adminhtml\Items\Column\Name
1111
{
12+
const COLUMN_NAME = 'name';
13+
1214
/**
1315
* Prepare item html
1416
*
@@ -24,8 +26,13 @@ protected function _toHtml()
2426
$item = $this->getItem();
2527
}
2628
if ($productType = $item->getRealProductType()) {
27-
$renderer = $this->getRenderedBlock()->getColumnHtml($this->getItem(), $productType);
28-
return $renderer;
29+
$renderer = $this->getRenderedBlock()->getColumnRenderer(self::COLUMN_NAME, $productType);
30+
if ($renderer) {
31+
$renderer->setItem($item);
32+
$renderer->setField(self::COLUMN_NAME);
33+
return $renderer->toHtml();
34+
}
35+
return '&nbsp;';
2936
}
3037
return parent::_toHtml();
3138
}

0 commit comments

Comments
 (0)