Skip to content

Commit 3cb293e

Browse files
author
Oleksandr Iegorov
committed
Merge branch '2.3-develop' of github.com:magento/magento2ce into MAGETWO-71537-2
2 parents 49b7941 + 23df0f3 commit 3cb293e

File tree

270 files changed

+3319
-1014
lines changed

Some content is hidden

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

270 files changed

+3319
-1014
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/Customer/Block/Account/Navigation.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,10 @@ public function getLinks()
4646
*/
4747
private function compare(SortLinkInterface $firstLink, SortLinkInterface $secondLink)
4848
{
49-
return ($firstLink->getSortOrder() < $secondLink->getSortOrder());
49+
if ($firstLink->getSortOrder() == $secondLink->getSortOrder()) {
50+
return 0;
51+
}
52+
53+
return ($firstLink->getSortOrder() < $secondLink->getSortOrder()) ? 1 : -1;
5054
}
5155
}

app/code/Magento/Directory/Model/Currency.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,7 @@ public function convert($price, $toCurrency = null)
225225
if ($toCurrency === null) {
226226
return $price;
227227
} elseif ($rate = $this->getRate($toCurrency)) {
228-
return $price * $rate;
228+
return floatval($price) * floatval($rate);
229229
}
230230

231231
throw new \Exception(__(

0 commit comments

Comments
 (0)