Skip to content

Commit afdb7ae

Browse files
author
Sergii Kovalenko
committed
Merge branch '2.3-develop' of https://github.com/magento/magento2ce into MAGETWO-89402
2 parents 6826fc0 + 18a7e29 commit afdb7ae

File tree

117 files changed

+2281
-633
lines changed

Some content is hidden

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

117 files changed

+2281
-633
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/Catalog/view/frontend/templates/product/view/form.phtml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
<input type="hidden" name="product" value="<?= /* @escapeNotVerified */ $_product->getId() ?>" />
2323
<input type="hidden" name="selected_configurable_option" value="" />
2424
<input type="hidden" name="related_product" id="related-products-field" value="" />
25+
<input type="hidden" name="item" value="<?= /* @noEscape */ $block->getRequest()->getParam('id') ?>" />
2526
<?= $block->getBlockHtml('formkey') ?>
2627
<?= $block->getChildHtml('form_top') ?>
2728
<?php if (!$block->hasOptions()):?>

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) {

0 commit comments

Comments
 (0)