Skip to content

Commit 9b1c425

Browse files
Merge branch '2.3-develop' of https://github.com/magento-performance/magento2ce into MAGETWO-90562
2 parents 21e76fc + 18a7e29 commit 9b1c425

File tree

32 files changed

+283
-73
lines changed

32 files changed

+283
-73
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/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
],

app/code/Magento/CatalogInventory/view/adminhtml/ui_component/product_form.xml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -571,7 +571,6 @@
571571
<settings>
572572
<scopeLabel>[GLOBAL]</scopeLabel>
573573
<validation>
574-
<rule name="validate-digits" xsi:type="boolean">true</rule>
575574
<rule name="validate-number" xsi:type="boolean">true</rule>
576575
</validation>
577576
<label translate="true">Qty Increments</label>

app/code/Magento/Cms/Helper/Wysiwyg/Images.php

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

1010
/**
1111
* Wysiwyg Images Helper.
12-
*
13-
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
1412
*/
1513
class Images extends \Magento\Framework\App\Helper\AbstractHelper
1614
{

app/code/Magento/Cms/view/adminhtml/web/js/folder-tree.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ define([
9494

9595
lastExistentFolderEl = folderEl;
9696

97-
if (path.length > 1) {
97+
if (path.length) {
9898
tree.jstree('open_node', folderEl, recursiveOpen);
9999
} else {
100100
tree.jstree('open_node', folderEl, function () {

app/code/Magento/Quote/Model/Quote.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2378,8 +2378,9 @@ protected function _afterLoad()
23782378
{
23792379
// collect totals and save me, if required
23802380
if (1 == $this->getTriggerRecollect()) {
2381-
$this->collectTotals()->save();
2382-
$this->setTriggerRecollect(0);
2381+
$this->collectTotals()
2382+
->setTriggerRecollect(0)
2383+
->save();
23832384
}
23842385
return parent::_afterLoad();
23852386
}

app/code/Magento/SalesInventory/Model/Order/ReturnProcessor.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@
1010

1111
/**
1212
* Class ReturnProcessor
13+
*
14+
* @api
1315
*/
1416
class ReturnProcessor
1517
{

0 commit comments

Comments
 (0)