Skip to content

Commit e9650c4

Browse files
author
Stanislav Idolov
committed
Merge remote-tracking branch 'mainline/2.3.1-release' into ENGCOM-3969-magento-magento2-20621-2.3.1-release
2 parents 2a884e5 + 1766f4c commit e9650c4

File tree

51 files changed

+781
-1311
lines changed

Some content is hidden

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

51 files changed

+781
-1311
lines changed

app/code/Magento/AuthorizenetAcceptjs/etc/payment.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Payment:etc/payment.xsd">
1010
<methods>
1111
<method name="authorizenet_acceptjs">
12-
<allow_multiple_address>1</allow_multiple_address>
12+
<allow_multiple_address>0</allow_multiple_address>
1313
</method>
1414
</methods>
1515
</payment>

app/code/Magento/AuthorizenetAcceptjs/view/base/requirejs-config.js

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,10 @@
44
*/
55

66
var config = {
7-
shim: {
8-
acceptjs: {
9-
exports: 'Accept'
10-
},
11-
acceptjssandbox: {
12-
exports: 'Accept'
7+
map: {
8+
'*': {
9+
acceptjssandbox: 'https://jstest.authorize.net/v1/Accept.js',
10+
acceptjs: 'https://js.authorize.net/v1/Accept.js'
1311
}
14-
},
15-
paths: {
16-
acceptjssandbox: 'https://jstest.authorize.net/v1/Accept',
17-
acceptjs: 'https://js.authorize.net/v1/Accept'
1812
}
1913
};

app/code/Magento/AuthorizenetAcceptjs/view/base/web/js/view/payment/acceptjs-factory.js

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ define([
1616
dependency = 'acceptjssandbox';
1717
}
1818

19-
require([dependency], function (accept) {
19+
require([dependency], function () {
2020
var $body = $('body');
2121

2222
/*
@@ -26,7 +26,16 @@ define([
2626
* Dynamically-loading-Accept-js-E-WC-03-Accept-js-is-not-loaded/td-p/63283
2727
*/
2828
$body.on('handshake.acceptjs', function () {
29-
deferred.resolve(accept);
29+
/*
30+
* Accept.js doesn't return the library when loading
31+
* and requirejs "shim" can't be used because it only works with the "paths" config option
32+
* and we can't use "paths" because require will try to load ".min.js" in production
33+
* and that doesn't work because it doesn't exist
34+
* and we can't add a query string to force a URL because accept.js will reject it
35+
* and we can't include it locally because they check in the script before loading more scripts
36+
* So, we use the global version as "shim" would
37+
*/
38+
deferred.resolve(window.Accept);
3039
$body.off('handshake.acceptjs');
3140
});
3241
},

app/code/Magento/Backup/Controller/Adminhtml/Index.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
namespace Magento\Backup\Controller\Adminhtml;
77

88
use Magento\Backend\App\Action;
9-
use Magento\Framework\App\Action\HttpGetActionInterface;
109
use Magento\Backup\Helper\Data as Helper;
1110
use Magento\Framework\App\ObjectManager;
1211

@@ -18,7 +17,7 @@
1817
* @since 100.0.2
1918
* @SuppressWarnings(PHPMD.AllPurposeAction)
2019
*/
21-
abstract class Index extends Action implements HttpGetActionInterface
20+
abstract class Index extends Action
2221
{
2322
/**
2423
* Authorization level of a basic admin session

app/code/Magento/Backup/Controller/Adminhtml/Index/Create.php

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,18 @@
11
<?php
22
/**
3-
*
43
* Copyright © Magento, Inc. All rights reserved.
54
* See COPYING.txt for license details.
65
*/
76
namespace Magento\Backup\Controller\Adminhtml\Index;
87

8+
use Magento\Framework\App\Action\HttpPostActionInterface;
99
use Magento\Framework\App\Filesystem\DirectoryList;
1010
use Magento\Framework\Filesystem;
1111

12-
class Create extends \Magento\Backup\Controller\Adminhtml\Index
12+
/**
13+
* Create backup controller
14+
*/
15+
class Create extends \Magento\Backup\Controller\Adminhtml\Index implements HttpPostActionInterface
1316
{
1417
/**
1518
* Create backup action.

app/code/Magento/Catalog/Test/Mftf/Test/AdminCreateCategoryWithProductsGridFilter.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
<actionGroup ref="deleteProductUsingProductGrid" stepKey="deleteProduct2">
2929
<argument name="product" value="SimpleProduct"/>
3030
</actionGroup>
31+
<actionGroup ref="NavigateToAndResetProductGridToDefaultView" stepKey="NavigateToAndResetProductGridToDefaultView"/>
3132
<actionGroup ref="logout" stepKey="logout"/>
3233
</after>
3334
<amOnPage url="{{AdminProductIndexPage.url}}" stepKey="amOnProductList"/>

app/code/Magento/Catalog/view/adminhtml/web/catalog/product/edit/attribute.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,13 @@
55

66
define([
77
'jquery',
8-
'mage/mage'
8+
'mage/mage',
9+
'validation'
910
], function ($) {
1011
'use strict';
1112

1213
return function (config, element) {
13-
14-
$(element).mage('form').mage('validation', {
14+
$(element).mage('form').validation({
1515
validationUrl: config.validationUrl
1616
});
1717
};

app/code/Magento/Elasticsearch/Model/Adapter/FieldMapper/Product/FieldProvider/DynamicField.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ public function getFields(array $context = []): array
126126
foreach ($groups as $group) {
127127
$groupPriceKey = $this->fieldNameResolver->getFieldName(
128128
$priceAttribute,
129-
array_merge($context, ['customerGroupId' => $group->getId()])
129+
['customerGroupId' => $group->getId(), 'websiteId' => $context['websiteId']]
130130
);
131131
$allAttributes[$groupPriceKey] = [
132132
'type' => $this->fieldTypeConverter->convert(FieldTypeConverterInterface::INTERNAL_DATA_TYPE_FLOAT),

app/code/Magento/Elasticsearch/SearchAdapter/Aggregation/Builder/Term.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,15 +22,13 @@ public function build(
2222
array $queryResult,
2323
DataProviderInterface $dataProvider
2424
) {
25-
$buckets = $queryResult['aggregations'][$bucket->getName()]['buckets'] ?? [];
2625
$values = [];
27-
foreach ($buckets as $resultBucket) {
26+
foreach ($queryResult['aggregations'][$bucket->getName()]['buckets'] as $resultBucket) {
2827
$values[$resultBucket['key']] = [
2928
'value' => $resultBucket['key'],
3029
'count' => $resultBucket['doc_count'],
3130
];
3231
}
33-
3432
return $values;
3533
}
3634
}

app/code/Magento/Elasticsearch/SearchAdapter/Query/Builder/Match.php

Lines changed: 13 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,6 @@
55
*/
66
namespace Magento\Elasticsearch\SearchAdapter\Query\Builder;
77

8-
use Magento\Elasticsearch\SearchAdapter\Query\ValueTransformerPool;
9-
use Magento\Framework\App\ObjectManager;
108
use Magento\Framework\Search\Request\Query\BoolExpression;
119
use Magento\Framework\Search\Request\QueryInterface as RequestQueryInterface;
1210
use Magento\Elasticsearch\Model\Adapter\FieldMapperInterface;
@@ -28,31 +26,20 @@ class Match implements QueryInterface
2826
private $fieldMapper;
2927

3028
/**
31-
* @deprecated
32-
* @see \Magento\Elasticsearch\SearchAdapter\Query\ValueTransformer\TextTransformer
3329
* @var PreprocessorInterface[]
3430
*/
3531
protected $preprocessorContainer;
3632

37-
/**
38-
* @var ValueTransformerPool
39-
*/
40-
private $valueTransformerPool;
41-
4233
/**
4334
* @param FieldMapperInterface $fieldMapper
4435
* @param PreprocessorInterface[] $preprocessorContainer
45-
* @param ValueTransformerPool|null $valueTransformerPool
4636
*/
4737
public function __construct(
4838
FieldMapperInterface $fieldMapper,
49-
array $preprocessorContainer,
50-
ValueTransformerPool $valueTransformerPool = null
39+
array $preprocessorContainer
5140
) {
5241
$this->fieldMapper = $fieldMapper;
5342
$this->preprocessorContainer = $preprocessorContainer;
54-
$this->valueTransformerPool = $valueTransformerPool ?? ObjectManager::getInstance()
55-
->get(ValueTransformerPool::class);
5643
}
5744

5845
/**
@@ -85,6 +72,10 @@ public function build(array $selectQuery, RequestQueryInterface $requestQuery, $
8572
*/
8673
protected function prepareQuery($queryValue, $conditionType)
8774
{
75+
$queryValue = $this->escape($queryValue);
76+
foreach ($this->preprocessorContainer as $preprocessor) {
77+
$queryValue = $preprocessor->process($queryValue);
78+
}
8879
$condition = $conditionType === BoolExpression::QUERY_CONDITION_NOT ?
8980
self::QUERY_CONDITION_MUST_NOT : $conditionType;
9081
return [
@@ -113,34 +104,21 @@ protected function buildQueries(array $matches, array $queryValue)
113104

114105
// Checking for quoted phrase \"phrase test\", trim escaped surrounding quotes if found
115106
$count = 0;
116-
$value = preg_replace('#^"(.*)"$#m', '$1', $queryValue['value'], -1, $count);
107+
$value = preg_replace('#^\\\\"(.*)\\\\"$#m', '$1', $queryValue['value'], -1, $count);
117108
$condition = ($count) ? 'match_phrase' : 'match';
118109

119-
$attributesTypes = $this->fieldMapper->getAllAttributesTypes();
120-
$transformedTypes = [];
121110
foreach ($matches as $match) {
122111
$resolvedField = $this->fieldMapper->getFieldName(
123112
$match['field'],
124113
['type' => FieldMapperInterface::TYPE_QUERY]
125114
);
126-
$valueTransformer = $this->valueTransformerPool->get($attributesTypes[$resolvedField]['type'] ?? 'text');
127-
$valueTransformerHash = \spl_object_hash($valueTransformer);
128-
if (!isset($transformedTypes[$valueTransformerHash])) {
129-
$transformedTypes[$valueTransformerHash] = $valueTransformer->transform($value);
130-
}
131-
$transformedValue = $transformedTypes[$valueTransformerHash];
132-
if (null === $transformedValue) {
133-
//Value is incompatible with this field type.
134-
continue;
135-
}
136-
137115
$conditions[] = [
138116
'condition' => $queryValue['condition'],
139117
'body' => [
140118
$condition => [
141119
$resolvedField => [
142-
'query' => $transformedValue,
143-
'boost' => $match['boost'] ?? 1,
120+
'query' => $value,
121+
'boost' => isset($match['boost']) ? $match['boost'] : 1,
144122
],
145123
],
146124
],
@@ -153,13 +131,16 @@ protected function buildQueries(array $matches, array $queryValue)
153131
/**
154132
* Escape a value for special query characters such as ':', '(', ')', '*', '?', etc.
155133
*
156-
* @deprecated
157-
* @see \Magento\Elasticsearch\SearchAdapter\Query\ValueTransformer\TextTransformer
134+
* Cut trailing plus or minus sign, and @ symbol, using of which causes InnoDB to report a syntax error.
135+
* https://dev.mysql.com/doc/refman/5.7/en/fulltext-boolean.html Fulltext-boolean search docs.
136+
*
158137
* @param string $value
159138
* @return string
160139
*/
161140
protected function escape($value)
162141
{
142+
$value = preg_replace('/@+|[@+-]+$/', '', $value);
143+
163144
$pattern = '/(\+|-|&&|\|\||!|\(|\)|\{|}|\[|]|\^|"|~|\*|\?|:|\\\)/';
164145
$replace = '\\\$1';
165146

0 commit comments

Comments
 (0)