Skip to content

Commit 82f3f83

Browse files
committed
Merge branch '2.3-develop-main' into team3-delivery
2 parents 3a6dbb9 + d3248d0 commit 82f3f83

File tree

82 files changed

+1703
-429
lines changed

Some content is hidden

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

82 files changed

+1703
-429
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ The members of this team have been recognized for their outstanding commitment t
3535
</a>
3636

3737
<h3>Top Contributors</h3>
38-
Magento team thanks for any contribution that can improve our code base, documentation or increase test coverage. We always recognize our most active members, your contributions are the foundation of the Magento open source platform.
38+
Magento is thankful for any contribution that can improve our code base, documentation or increase test coverage. We always recognize our most active members, as their contributions are the foundation of the Magento Open Source platform.
3939
<a href="https://magento.com/magento-contributors">
4040
<img src="https://raw.githubusercontent.com/wiki/magento/magento2/images/contributors.png"/>
4141
</a>

app/code/Magento/Backend/Model/Url.php

Lines changed: 17 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -202,33 +202,36 @@ public function getUrl($routePath = null, $routeParams = null)
202202
}
203203

204204
$cacheSecretKey = false;
205-
if (is_array($routeParams) && isset($routeParams['_cache_secret_key'])) {
205+
if (isset($routeParams['_cache_secret_key'])) {
206206
unset($routeParams['_cache_secret_key']);
207207
$cacheSecretKey = true;
208208
}
209209
$result = parent::getUrl($routePath, $routeParams);
210210
if (!$this->useSecretKey()) {
211211
return $result;
212212
}
213+
214+
$this->getRouteParamsResolver()->unsetData('route_params');
213215
$this->_setRoutePath($routePath);
216+
$extraParams = $this->getRouteParamsResolver()->getRouteParams();
214217
$routeName = $this->_getRouteName('*');
215218
$controllerName = $this->_getControllerName(self::DEFAULT_CONTROLLER_NAME);
216219
$actionName = $this->_getActionName(self::DEFAULT_ACTION_NAME);
217-
if ($cacheSecretKey) {
218-
$secret = [self::SECRET_KEY_PARAM_NAME => "\${$routeName}/{$controllerName}/{$actionName}\$"];
219-
} else {
220-
$secret = [
221-
self::SECRET_KEY_PARAM_NAME => $this->getSecretKey($routeName, $controllerName, $actionName),
222-
];
223-
}
224-
if (is_array($routeParams)) {
225-
$routeParams = array_merge($secret, $routeParams);
226-
} else {
227-
$routeParams = $secret;
220+
221+
if (!isset($routeParams[self::SECRET_KEY_PARAM_NAME])) {
222+
if (!is_array($routeParams)) {
223+
$routeParams = [];
224+
}
225+
$secretKey = $cacheSecretKey
226+
? "\${$routeName}/{$controllerName}/{$actionName}\$"
227+
: $this->getSecretKey($routeName, $controllerName, $actionName);
228+
$routeParams[self::SECRET_KEY_PARAM_NAME] = $secretKey;
228229
}
229-
if (is_array($this->_getRouteParams())) {
230-
$routeParams = array_merge($this->_getRouteParams(), $routeParams);
230+
231+
if (!empty($extraParams)) {
232+
$routeParams = array_merge($extraParams, $routeParams);
231233
}
234+
232235
return parent::getUrl("{$routeName}/{$controllerName}/{$actionName}", $routeParams);
233236
}
234237

app/code/Magento/Catalog/Test/Unit/Model/CategoryTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -468,7 +468,7 @@ public function testGetCustomAttributes()
468468
);
469469

470470
//Change the attribute value, should reflect in getCustomAttribute
471-
$this->category->setData($customAttributeCode, $newCustomAttributeValue);
471+
$this->category->setCustomAttribute($customAttributeCode, $newCustomAttributeValue);
472472
$this->assertEquals(1, count($this->category->getCustomAttributes()));
473473
$this->assertNotNull($this->category->getCustomAttribute($customAttributeCode));
474474
$this->assertEquals(

app/code/Magento/Catalog/Test/Unit/Model/ProductTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1305,7 +1305,7 @@ public function testGetCustomAttributes()
13051305
);
13061306

13071307
//Change the attribute value, should reflect in getCustomAttribute
1308-
$this->model->setData($customAttributeCode, $newCustomAttributeValue);
1308+
$this->model->setCustomAttribute($customAttributeCode, $newCustomAttributeValue);
13091309
$this->assertEquals(1, count($this->model->getCustomAttributes()));
13101310
$this->assertNotNull($this->model->getCustomAttribute($customAttributeCode));
13111311
$this->assertEquals(

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1703,7 +1703,7 @@ protected function _saveProducts()
17031703
$storeId = !empty($rowData[self::COL_STORE])
17041704
? $this->getStoreIdByCode($rowData[self::COL_STORE])
17051705
: Store::DEFAULT_STORE_ID;
1706-
if (isset($rowData['_media_is_disabled'])) {
1706+
if (isset($rowData['_media_is_disabled']) && strlen(trim($rowData['_media_is_disabled']))) {
17071707
$disabledImages = array_flip(
17081708
explode($this->getMultipleValueSeparator(), $rowData['_media_is_disabled'])
17091709
);

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -503,7 +503,7 @@ public function prepareAttributesWithDefaultValueForSave(array $rowData, $withDe
503503
if ($attrParams['is_static']) {
504504
continue;
505505
}
506-
if (isset($rowData[$attrCode]) && strlen($rowData[$attrCode])) {
506+
if (isset($rowData[$attrCode]) && strlen(trim($rowData[$attrCode]))) {
507507
if (in_array($attrParams['type'], ['select', 'boolean'])) {
508508
$resultAttrs[$attrCode] = $attrParams['options'][strtolower($rowData[$attrCode])];
509509
} elseif ('multiselect' == $attrParams['type']) {

app/code/Magento/CatalogInventory/Api/StockConfigurationInterface.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ public function getEnableQtyIncrements($storeId = null);
7777

7878
/**
7979
* @param int $storeId
80-
* @return int
80+
* @return float
8181
*/
8282
public function getQtyIncrements($store = null);
8383

app/code/Magento/CatalogInventory/Model/Configuration.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -273,7 +273,7 @@ public function getEnableQtyIncrements($store = null)
273273

274274
/**
275275
* @param null|string|bool|int|\Magento\Store\Model\Store $store
276-
* @return int
276+
* @return float
277277
*/
278278
public function getQtyIncrements($store = null)
279279
{

app/code/Magento/CatalogInventory/Model/Stock/Item.php

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -392,7 +392,7 @@ public function getUseConfigQtyIncrements()
392392
/**
393393
* Retrieve Quantity Increments
394394
*
395-
* @return int|false
395+
* @return int|float|false
396396
*/
397397
public function getQtyIncrements()
398398
{
@@ -401,7 +401,13 @@ public function getQtyIncrements()
401401
if ($this->getUseConfigQtyIncrements()) {
402402
$this->qtyIncrements = $this->stockConfiguration->getQtyIncrements($this->getStoreId());
403403
} else {
404-
$this->qtyIncrements = (int) $this->getData(static::QTY_INCREMENTS);
404+
$this->qtyIncrements = $this->getData(static::QTY_INCREMENTS);
405+
}
406+
407+
if ($this->getIsQtyDecimal()) { // Cast accordingly to decimal qty usage
408+
$this->qtyIncrements = (float) $this->qtyIncrements;
409+
} else {
410+
$this->qtyIncrements = (int) $this->qtyIncrements;
405411
}
406412
}
407413
if ($this->qtyIncrements <= 0) {

app/code/Magento/CatalogInventory/Test/Unit/Model/Stock/ItemTest.php

Lines changed: 25 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -394,6 +394,7 @@ public function testGetQtyIncrements($config, $expected)
394394
$this->setDataArrayValue('qty_increments', $config['qty_increments']);
395395
$this->setDataArrayValue('enable_qty_increments', $config['enable_qty_increments']);
396396
$this->setDataArrayValue('use_config_qty_increments', $config['use_config_qty_increments']);
397+
$this->setDataArrayValue('is_qty_decimal', $config['is_qty_decimal']);
397398
if ($config['use_config_qty_increments']) {
398399
$this->stockConfiguration->expects($this->once())
399400
->method('getQtyIncrements')
@@ -415,23 +416,44 @@ public function getQtyIncrementsDataProvider()
415416
[
416417
'qty_increments' => 1,
417418
'enable_qty_increments' => true,
418-
'use_config_qty_increments' => true
419+
'use_config_qty_increments' => true,
420+
'is_qty_decimal' => false,
421+
],
422+
1
423+
],
424+
[
425+
[
426+
'qty_increments' => 1.5,
427+
'enable_qty_increments' => true,
428+
'use_config_qty_increments' => true,
429+
'is_qty_decimal' => true,
430+
],
431+
1.5
432+
],
433+
[
434+
[
435+
'qty_increments' => 1.5,
436+
'enable_qty_increments' => true,
437+
'use_config_qty_increments' => true,
438+
'is_qty_decimal' => false,
419439
],
420440
1
421441
],
422442
[
423443
[
424444
'qty_increments' => -2,
425445
'enable_qty_increments' => true,
426-
'use_config_qty_increments' => true
446+
'use_config_qty_increments' => true,
447+
'is_qty_decimal' => false,
427448
],
428449
false
429450
],
430451
[
431452
[
432453
'qty_increments' => 3,
433454
'enable_qty_increments' => true,
434-
'use_config_qty_increments' => false
455+
'use_config_qty_increments' => false,
456+
'is_qty_decimal' => false,
435457
],
436458
3
437459
],

0 commit comments

Comments
 (0)