Skip to content

Commit 3c497e4

Browse files
merge magento/2.4.0-develop into magento-qwerty/MC-35064
2 parents b917a01 + e89cd6a commit 3c497e4

File tree

74 files changed

+1028
-412
lines changed

Some content is hidden

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

74 files changed

+1028
-412
lines changed

app/code/Magento/Catalog/Controller/Category/View.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -205,10 +205,9 @@ protected function _initCategory()
205205
/**
206206
* Category view action
207207
*
208-
* @return ResultInterface
209208
* @throws NoSuchEntityException
210209
*/
211-
public function execute(): ?ResultInterface
210+
public function execute()
212211
{
213212
$result = null;
214213

app/code/Magento/Catalog/Model/FilterProductCustomAttribute.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,21 +8,21 @@
88
namespace Magento\Catalog\Model;
99

1010
/**
11-
* Filter custom attributes for product using the blacklist
11+
* Filter custom attributes for product using the excluded list
1212
*/
1313
class FilterProductCustomAttribute
1414
{
1515
/**
1616
* @var array
1717
*/
18-
private $blackList;
18+
private $excludedList;
1919

2020
/**
21-
* @param array $blackList
21+
* @param array $excludedList
2222
*/
23-
public function __construct(array $blackList = [])
23+
public function __construct(array $excludedList = [])
2424
{
25-
$this->blackList = $blackList;
25+
$this->excludedList = $excludedList;
2626
}
2727

2828
/**
@@ -33,6 +33,6 @@ public function __construct(array $blackList = [])
3333
*/
3434
public function execute(array $attributes): array
3535
{
36-
return array_diff_key($attributes, array_flip($this->blackList));
36+
return array_diff_key($attributes, array_flip($this->excludedList));
3737
}
3838
}

app/code/Magento/CatalogInventory/etc/di.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
</type>
3838
<type name="Magento\Catalog\Model\FilterProductCustomAttribute">
3939
<arguments>
40-
<argument name="blackList" xsi:type="array">
40+
<argument name="excludedList" xsi:type="array">
4141
<item name="quantity_and_stock_status" xsi:type="string">quantity_and_stock_status</item>
4242
</argument>
4343
</arguments>

app/code/Magento/Checkout/view/frontend/web/js/empty-cart.js

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,16 @@
33
* See COPYING.txt for license details.
44
*/
55

6-
define([
7-
'Magento_Customer/js/customer-data'
8-
], function (customerData) {
6+
define(['Magento_Customer/js/customer-data'], function (customerData) {
97
'use strict';
108

11-
var cartData = customerData.get('cart');
9+
return function () {
10+
var cartData = customerData.get('cart');
1211

13-
if (cartData().items && cartData().items.length !== 0) {
14-
customerData.reload(['cart'], false);
15-
}
12+
customerData.getInitCustomerData().done(function () {
13+
if (cartData().items && cartData().items.length !== 0) {
14+
customerData.reload(['cart'], false);
15+
}
16+
});
17+
};
1618
});

app/code/Magento/Customer/view/frontend/web/js/customer-data.js

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,8 @@ define([
2424
invalidateCacheByCloseCookieSession,
2525
dataProvider,
2626
buffer,
27-
customerData;
27+
customerData,
28+
deferred = $.Deferred();
2829

2930
url.setBaseUrl(window.BASE_URL);
3031
options.sectionLoadUrl = url.build('customer/section/load');
@@ -341,6 +342,15 @@ define([
341342
$.cookieStorage.set('section_data_ids', sectionDataIds);
342343
},
343344

345+
/**
346+
* Checks if customer data is initialized.
347+
*
348+
* @returns {jQuery.Deferred}
349+
*/
350+
getInitCustomerData: function () {
351+
return deferred.promise();
352+
},
353+
344354
/**
345355
* @param {Object} settings
346356
* @constructor
@@ -350,6 +360,7 @@ define([
350360
invalidateCacheBySessionTimeOut(settings);
351361
invalidateCacheByCloseCookieSession();
352362
customerData.init();
363+
deferred.resolve();
353364
}
354365
};
355366

app/code/Magento/Eav/Model/Validator/Attribute/Data.php

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,12 @@ class Data extends \Magento\Framework\Validator\AbstractValidator
2323
/**
2424
* @var array
2525
*/
26-
protected $_attributesWhiteList = [];
26+
protected $allowedAttributesList = [];
2727

2828
/**
2929
* @var array
3030
*/
31-
protected $_attributesBlackList = [];
31+
protected $deniedAttributesList = [];
3232

3333
/**
3434
* @var array
@@ -68,9 +68,9 @@ public function setAttributes(array $attributes)
6868
* @param array $attributesCodes
6969
* @return $this
7070
*/
71-
public function setAttributesWhiteList(array $attributesCodes)
71+
public function setAllowedAttributesList(array $attributesCodes)
7272
{
73-
$this->_attributesWhiteList = $attributesCodes;
73+
$this->allowedAttributesList = $attributesCodes;
7474
return $this;
7575
}
7676

@@ -82,9 +82,9 @@ public function setAttributesWhiteList(array $attributesCodes)
8282
* @param array $attributesCodes
8383
* @return $this
8484
*/
85-
public function setAttributesBlackList(array $attributesCodes)
85+
public function setDeniedAttributesList(array $attributesCodes)
8686
{
87-
$this->_attributesBlackList = $attributesCodes;
87+
$this->deniedAttributesList = $attributesCodes;
8888
return $this;
8989
}
9090

@@ -171,11 +171,11 @@ protected function _getAttributes($entity)
171171
$attributesCodes[] = $attributeCode;
172172
}
173173

174-
$ignoreAttributes = $this->_attributesBlackList;
175-
if ($this->_attributesWhiteList) {
174+
$ignoreAttributes = $this->deniedAttributesList;
175+
if ($this->allowedAttributesList) {
176176
$ignoreAttributes = array_merge(
177177
$ignoreAttributes,
178-
array_diff($attributesCodes, $this->_attributesWhiteList)
178+
array_diff($attributesCodes, $this->allowedAttributesList)
179179
);
180180
}
181181

app/code/Magento/Eav/Test/Unit/Model/Validator/Attribute/DataTest.php

Lines changed: 17 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -249,10 +249,10 @@ public function testIsValidAttributesFromCollection()
249249
}
250250

251251
/**
252-
* @dataProvider whiteBlackListProvider
252+
* @dataProvider allowDenyListProvider
253253
* @param callable $callback
254254
*/
255-
public function testIsValidBlackListWhiteListChecks($callback)
255+
public function testIsValidExclusionInclusionListChecks($callback)
256256
{
257257
$attribute = $this->_getAttributeMock(
258258
[
@@ -302,19 +302,19 @@ public function testIsValidBlackListWhiteListChecks($callback)
302302
/**
303303
* @return array
304304
*/
305-
public function whiteBlackListProvider()
305+
public function allowDenyListProvider()
306306
{
307-
$whiteCallback = function ($validator) {
308-
$validator->setAttributesWhiteList(['attribute']);
307+
$allowedCallbackList = function ($validator) {
308+
$validator->setAllowedAttributesList(['attribute']);
309309
};
310310

311-
$blackCallback = function ($validator) {
312-
$validator->setAttributesBlackList(['attribute2']);
311+
$deniedCallbackList = function ($validator) {
312+
$validator->setDeniedAttributesList(['attribute2']);
313313
};
314-
return ['white_list' => [$whiteCallback], 'black_list' => [$blackCallback]];
314+
return ['allowed' => [$allowedCallbackList], 'denied' => [$deniedCallbackList]];
315315
}
316316

317-
public function testSetAttributesWhiteList()
317+
public function testSetAttributesAllowedList()
318318
{
319319
$this->markTestSkipped('Skipped in #27500 due to testing protected/private methods and properties');
320320

@@ -328,12 +328,14 @@ public function testSetAttributesWhiteList()
328328
)
329329
->getMock();
330330
$validator = new Data($attrDataFactory);
331-
$result = $validator->setAttributesWhiteList($attributes);
332-
$this->assertAttributeEquals($attributes, '_attributesWhiteList', $validator);
331+
$result = $validator->setIncludedAttributesList($attributes);
332+
333+
// phpstan:ignore
334+
$this->assertAttributeEquals($attributes, '_attributesAllowed', $validator);
333335
$this->assertEquals($validator, $result);
334336
}
335337

336-
public function testSetAttributesBlackList()
338+
public function testSetAttributesDeniedList()
337339
{
338340
$this->markTestSkipped('Skipped in #27500 due to testing protected/private methods and properties');
339341

@@ -347,8 +349,9 @@ public function testSetAttributesBlackList()
347349
)
348350
->getMock();
349351
$validator = new Data($attrDataFactory);
350-
$result = $validator->setAttributesBlackList($attributes);
351-
$this->assertAttributeEquals($attributes, '_attributesBlackList', $validator);
352+
$result = $validator->setDeniedAttributesList($attributes);
353+
// phpstan:ignore
354+
$this->assertAttributeEquals($attributes, '_attributesDenied', $validator);
352355
$this->assertEquals($validator, $result);
353356
}
354357

app/code/Magento/Elasticsearch/composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
"magento/module-store": "*",
1313
"magento/module-catalog-inventory": "*",
1414
"magento/framework": "*",
15-
"elasticsearch/elasticsearch": "~7.6"
15+
"elasticsearch/elasticsearch": "~7.7.0"
1616
},
1717
"suggest": {
1818
"magento/module-config": "*"

app/code/Magento/Elasticsearch/etc/di.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -537,7 +537,7 @@
537537
</type>
538538
<type name="Magento\Search\Model\SearchEngine\Validator">
539539
<arguments>
540-
<argument name="engineBlacklist" xsi:type="array">
540+
<argument name="excludedEngineList" xsi:type="array">
541541
<item name="elasticsearch" xsi:type="string">Elasticsearch 2</item>
542542
</argument>
543543
<argument name="engineValidators" xsi:type="array">

app/code/Magento/Elasticsearch6/Block/Adminhtml/System/Config/TestConnection.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77

88
/**
99
* Elasticsearch 6.x test connection block
10+
* @deprecated the new minor release supports compatibility with Elasticsearch 7
1011
*/
1112
class TestConnection extends \Magento\AdvancedSearch\Block\Adminhtml\System\Config\TestConnection
1213
{

0 commit comments

Comments
 (0)