Skip to content

Commit 5aa4948

Browse files
authored
Merge pull request magento#5422 from magento-tsg/2.3-develop-pr114
[TSG] Fixes for 2.3 (pr114) (2.3-develop)
2 parents db91250 + 525f6b4 commit 5aa4948

File tree

34 files changed

+210
-345
lines changed

34 files changed

+210
-345
lines changed

app/code/Magento/Authorizenet/etc/adminhtml/system.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
<section id="payment">
1111
<group id="authorizenet_directpost" translate="label" type="text" sortOrder="34" showInDefault="1" showInWebsite="1" showInStore="1">
1212
<label>Authorize.Net Direct Post (Deprecated)</label>
13+
<attribute type="displayIn">deprecated_payment_methods</attribute>
1314
<field id="active" translate="label" type="select" sortOrder="10" showInDefault="1" showInWebsite="1" showInStore="0" canRestore="1">
1415
<label>Enabled</label>
1516
<source_model>Magento\Config\Model\Config\Source\Yesno</source_model>

app/code/Magento/AuthorizenetAcceptjs/etc/adminhtml/system.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
<section id="payment">
1111
<group id="authorizenet_acceptjs" translate="label" type="text" sortOrder="34" showInDefault="1" showInWebsite="1" showInStore="1">
1212
<label>Authorize.Net (Deprecated)</label>
13+
<attribute type="displayIn">deprecated_payment_methods</attribute>
1314
<field id="active" translate="label" type="select" sortOrder="10" showInDefault="1" showInWebsite="1" showInStore="0" canRestore="1">
1415
<label>Enabled</label>
1516
<source_model>Magento\Config\Model\Config\Source\Yesno</source_model>

app/code/Magento/Catalog/Model/Layer/FilterList.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -110,9 +110,9 @@ protected function getAttributeFilterClass(\Magento\Catalog\Model\ResourceModel\
110110
{
111111
$filterClassName = $this->filterTypes[self::ATTRIBUTE_FILTER];
112112

113-
if ($attribute->getFrontendInput() === 'price') {
113+
if ($attribute->getAttributeCode() == 'price') {
114114
$filterClassName = $this->filterTypes[self::PRICE_FILTER];
115-
} elseif ($attribute->getBackendType() === 'decimal') {
115+
} elseif ($attribute->getBackendType() == 'decimal') {
116116
$filterClassName = $this->filterTypes[self::DECIMAL_FILTER];
117117
}
118118

app/code/Magento/Catalog/Test/Mftf/Data/ProductAttributeData.xml

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -282,28 +282,6 @@
282282
<data key="used_for_sort_by">false</data>
283283
<requiredEntity type="FrontendLabel">ProductAttributeFrontendLabel</requiredEntity>
284284
</entity>
285-
<entity name="productAttributeTypeOfPrice" type="ProductAttribute">
286-
<data key="attribute_code" unique="suffix">attribute</data>
287-
<data key="frontend_input">price</data>
288-
<data key="scope">global</data>
289-
<data key="is_required">false</data>
290-
<data key="is_unique">false</data>
291-
<data key="is_searchable">false</data>
292-
<data key="is_visible">true</data>
293-
<data key="is_wysiwyg_enabled">false</data>
294-
<data key="is_visible_in_advanced_search">false</data>
295-
<data key="is_visible_on_front">true</data>
296-
<data key="is_filterable">true</data>
297-
<data key="is_filterable_in_search">false</data>
298-
<data key="used_in_product_listing">false</data>
299-
<data key="is_used_for_promo_rules">false</data>
300-
<data key="is_comparable">true</data>
301-
<data key="is_used_in_grid">false</data>
302-
<data key="is_visible_in_grid">false</data>
303-
<data key="is_filterable_in_grid">false</data>
304-
<data key="used_for_sort_by">false</data>
305-
<requiredEntity type="FrontendLabel">ProductAttributeFrontendLabel</requiredEntity>
306-
</entity>
307285
<entity name="textProductAttribute" extends="productAttributeWysiwyg" type="ProductAttribute">
308286
<data key="frontend_input">text</data>
309287
<data key="default_value" unique="suffix">defaultValue</data>

app/code/Magento/Catalog/Test/Mftf/Section/AdminProductFormSection.xml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,6 @@
218218
<element name="textAttributeByName" type="text" selector="//div[@data-index='attributes']//fieldset[contains(@class, 'admin__field') and .//*[contains(.,'{{var}}')]]//input" parameterized="true"/>
219219
<element name="dropDownAttribute" type="select" selector="//select[@name='product[{{arg}}]']" parameterized="true" timeout="30"/>
220220
<element name="attributeSection" type="block" selector="//div[@data-index='attributes']/div[contains(@class, 'admin__collapsible-content _show')]" timeout="30"/>
221-
<element name="customAttribute" type="text" selector="product[{{attributecode}}]" timeout="30" parameterized="true"/>
222221
<element name="attributeGroupByName" type="button" selector="//div[@class='fieldset-wrapper-title']//span[text()='{{group}}']" parameterized="true"/>
223222
<element name="attributeByGroupAndName" type="text" selector="//div[@class='fieldset-wrapper-title']//span[text()='{{group}}']/../../following-sibling::div//span[contains(text(),'attribute')]" parameterized="true"/>
224223
</section>

app/code/Magento/Catalog/Test/Mftf/Section/StorefrontCategoryFilterSection.xml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,5 @@
1111
<section name="StorefrontCategoryFilterSection">
1212
<element name="CategoryFilter" type="button" selector="//main//div[@class='filter-options']//div[contains(text(), 'Category')]"/>
1313
<element name="CategoryByName" type="button" selector="//main//div[@class='filter-options']//li[@class='item']//a[contains(text(), '{{var1}}')]" parameterized="true"/>
14-
<element name="CustomPriceAttribute" type="button" selector="div.filter-options-title"/>
1514
</section>
1615
</sections>

app/code/Magento/Catalog/Test/Unit/Model/Layer/FilterListTest.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -100,8 +100,8 @@ public function getFiltersDataProvider()
100100
{
101101
return [
102102
[
103-
'method' => 'getFrontendInput',
104-
'value' => 'price',
103+
'method' => 'getAttributeCode',
104+
'value' => FilterList::PRICE_FILTER,
105105
'expectedClass' => 'PriceFilterClass',
106106
],
107107
[
@@ -110,8 +110,8 @@ public function getFiltersDataProvider()
110110
'expectedClass' => 'DecimalFilterClass',
111111
],
112112
[
113-
'method' => 'getFrontendInput',
114-
'value' => 'text',
113+
'method' => 'getAttributeCode',
114+
'value' => null,
115115
'expectedClass' => 'AttributeFilterClass',
116116
]
117117
];

app/code/Magento/CatalogInventory/Model/Quote/Item/QuantityValidator/QuoteItemQtyList.php

Lines changed: 20 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,12 @@
33
* Copyright © Magento, Inc. All rights reserved.
44
* See COPYING.txt for license details.
55
*/
6+
67
namespace Magento\CatalogInventory\Model\Quote\Item\QuantityValidator;
78

9+
/**
10+
* Process product qty from quote items.
11+
*/
812
class QuoteItemQtyList
913
{
1014
/**
@@ -16,12 +20,13 @@ class QuoteItemQtyList
1620
protected $_checkedQuoteItems = [];
1721

1822
/**
19-
* Get product qty includes information from all quote items
20-
* Need be used only in singleton mode
23+
* Get product qty includes information from all quote items.
2124
*
22-
* @param int $productId
23-
* @param int $quoteItemId
24-
* @param int $quoteId
25+
* Need be used only in singleton mode.
26+
*
27+
* @param int $productId
28+
* @param int $quoteItemId
29+
* @param int $quoteId
2530
* @param float $itemQty
2631
*
2732
* @return int
@@ -44,4 +49,14 @@ public function getQty($productId, $quoteItemId, $quoteId, $itemQty)
4449

4550
return $qty;
4651
}
52+
53+
/**
54+
* Clear array with checked Quote items.
55+
*
56+
* @return void
57+
*/
58+
public function clear(): void
59+
{
60+
$this->_checkedQuoteItems = [];
61+
}
4762
}

app/code/Magento/CatalogSearch/Model/Layer/Filter/Decimal.php

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,6 @@
1414
*/
1515
class Decimal extends AbstractFilter
1616
{
17-
/** Decimal delta for filter */
18-
private const DECIMAL_DELTA = 0.001;
19-
2017
/**
2118
* @var \Magento\Framework\Pricing\PriceCurrencyInterface
2219
*/
@@ -75,17 +72,11 @@ public function apply(\Magento\Framework\App\RequestInterface $request)
7572

7673
list($from, $to) = explode('-', $filter);
7774

78-
// When the range is 10-20 we only need to get products that are in the 10-19.99 range.
79-
$toValue = $to;
80-
if (!empty($toValue) && $from !== $toValue) {
81-
$toValue -= self::DECIMAL_DELTA;
82-
}
83-
8475
$this->getLayer()
8576
->getProductCollection()
8677
->addFieldToFilter(
8778
$this->getAttributeModel()->getAttributeCode(),
88-
['from' => $from, 'to' => $toValue]
79+
['from' => $from, 'to' => $to]
8980
);
9081

9182
$this->getLayer()->getState()->addFilter(
@@ -122,7 +113,7 @@ protected function _getItemsData()
122113
$from = '';
123114
}
124115
if ($to == '*') {
125-
$to = '';
116+
$to = null;
126117
}
127118
$label = $this->renderRangeLabel(empty($from) ? 0 : $from, $to);
128119
$value = $from . '-' . $to;
@@ -149,7 +140,7 @@ protected function _getItemsData()
149140
protected function renderRangeLabel($fromPrice, $toPrice)
150141
{
151142
$formattedFromPrice = $this->priceCurrency->format($fromPrice);
152-
if ($toPrice === '') {
143+
if ($toPrice === null) {
153144
return __('%1 and above', $formattedFromPrice);
154145
} else {
155146
if ($fromPrice != $toPrice) {

app/code/Magento/CatalogSearch/Model/Layer/Filter/Price.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ public function apply(\Magento\Framework\App\RequestInterface $request)
141141
list($from, $to) = $filter;
142142

143143
$this->getLayer()->getProductCollection()->addFieldToFilter(
144-
$this->getAttributeModel()->getAttributeCode(),
144+
'price',
145145
['from' => $from, 'to' => empty($to) || $from == $to ? $to : $to - self::PRICE_DELTA]
146146
);
147147

app/code/Magento/CatalogSearch/Model/Search/RequestGenerator.php

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -100,10 +100,7 @@ private function generateRequest($attributeType, $container, $useFulltext)
100100
],
101101
];
102102
$bucketName = $attribute->getAttributeCode() . self::BUCKET_SUFFIX;
103-
$generatorType = $attribute->getFrontendInput() === 'price'
104-
? $attribute->getFrontendInput()
105-
: $attribute->getBackendType();
106-
$generator = $this->generatorResolver->getGeneratorForType($generatorType);
103+
$generator = $this->generatorResolver->getGeneratorForType($attribute->getBackendType());
107104
$request['filters'][$filterName] = $generator->getFilterData($attribute, $filterName);
108105
$request['aggregations'][$bucketName] = $generator->getAggregationData($attribute, $bucketName);
109106
}

app/code/Magento/CatalogSearch/Model/Search/RequestGenerator/Price.php

Lines changed: 0 additions & 46 deletions
This file was deleted.

app/code/Magento/CatalogSearch/Test/Mftf/Test/LayerNavigationOfCatalogSearchTest.xml

Lines changed: 0 additions & 92 deletions
This file was deleted.

app/code/Magento/CatalogSearch/Test/Unit/Model/Layer/Filter/PriceTest.php

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -209,12 +209,6 @@ public function testApply()
209209
$priceId = '15-50';
210210
$requestVar = 'test_request_var';
211211

212-
$this->target->setAttributeModel($this->attribute);
213-
$attributeCode = 'price';
214-
$this->attribute->expects($this->any())
215-
->method('getAttributeCode')
216-
->will($this->returnValue($attributeCode));
217-
218212
$this->target->setRequestVar($requestVar);
219213
$this->request->expects($this->exactly(1))
220214
->method('getParam')

0 commit comments

Comments
 (0)