Skip to content

Commit 71e61a7

Browse files
🔃 [EngCom] Public Pull Requests - 2.2-develop
Accepted Public Pull Requests: - #21589: [Backport] Issue fixed #20128 : Date range returns the same start and end date (by @mage2pratik) - #21080: [Backport] A non-numeric value encountered on mass product update when.. (by @Nazar65) Fixed GitHub Issues: - #20128: Magento\Reports\Model\ResourceModel\Order\Collection->getDateRange() - Error in code? (reported by @realJustmike) has been fixed in #21589 by @mage2pratik in 2.2-develop branch Related commits: 1. 8874332 2. a75958f - #21073: A non-numeric value encountered on mass product update when Minimum Qty Allowed in Shopping Cart is used (reported by @kamilszewczyk) has been fixed in #21080 by @Nazar65 in 2.2-develop branch Related commits: 1. 9d858b3 2. ca72609 3. f31e7f0
2 parents ae9cd83 + 1df10d8 commit 71e61a7

File tree

3 files changed

+17
-6
lines changed

3 files changed

+17
-6
lines changed

app/code/Magento/Catalog/Block/Adminhtml/Product/Edit/Action/Attribute/Tab/Inventory.php

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -70,11 +70,11 @@ public function getFieldSuffix()
7070
* Retrieve current store id
7171
*
7272
* @return int
73+
* @SuppressWarnings(PHPMD.RequestAwareBlockMethod)
7374
*/
7475
public function getStoreId()
7576
{
76-
$storeId = $this->getRequest()->getParam('store');
77-
return (int)$storeId;
77+
return (int)$this->getRequest()->getParam('store');
7878
}
7979

8080
/**
@@ -99,6 +99,8 @@ public function getTabLabel()
9999
}
100100

101101
/**
102+
* Return Tab title.
103+
*
102104
* @return \Magento\Framework\Phrase
103105
*/
104106
public function getTabTitle()
@@ -107,22 +109,24 @@ public function getTabTitle()
107109
}
108110

109111
/**
110-
* @return bool
112+
* @inheritdoc
111113
*/
112114
public function canShowTab()
113115
{
114116
return true;
115117
}
116118

117119
/**
118-
* @return bool
120+
* @inheritdoc
119121
*/
120122
public function isHidden()
121123
{
122124
return false;
123125
}
124126

125127
/**
128+
* Get availability status.
129+
*
126130
* @param string $fieldName
127131
* @return bool
128132
* @SuppressWarnings(PHPMD.UnusedFormalParameter)

app/code/Magento/Catalog/view/adminhtml/templates/catalog/product/edit/action/inventory.phtml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,13 @@
3030
});
3131
</script>
3232

33+
<?php
34+
$defaultMinSaleQty = $block->getDefaultConfigValue('min_sale_qty');
35+
if (!is_numeric($defaultMinSaleQty)) {
36+
$defaultMinSaleQty = json_decode($defaultMinSaleQty, true);
37+
$defaultMinSaleQty = (float) $defaultMinSaleQty[\Magento\Customer\Api\Data\GroupInterface::CUST_GROUP_ALL] ?? 1;
38+
}
39+
?>
3340
<div class="fieldset-wrapper form-inline advanced-inventory-edit">
3441
<div class="fieldset-wrapper-title">
3542
<strong class="title">
@@ -132,7 +139,7 @@
132139
<div class="field">
133140
<input type="text" class="input-text validate-number" id="inventory_min_sale_qty"
134141
name="<?= /* @escapeNotVerified */ $block->getFieldSuffix() ?>[min_sale_qty]"
135-
value="<?= /* @escapeNotVerified */ $block->getDefaultConfigValue('min_sale_qty') * 1 ?>"
142+
value="<?= /* @escapeNotVerified */ $defaultMinSaleQty ?>"
136143
disabled="disabled"/>
137144
</div>
138145
<div class="field choice">

app/code/Magento/Reports/Model/ResourceModel/Order/Collection.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -445,7 +445,7 @@ public function getDateRange($range, $customStart, $customEnd, $returnObjects =
445445
break;
446446

447447
case 'custom':
448-
$dateStart = $customStart ? $customStart : $dateEnd;
448+
$dateStart = $customStart ? $customStart : $dateStart;
449449
$dateEnd = $customEnd ? $customEnd : $dateEnd;
450450
break;
451451

0 commit comments

Comments
 (0)