Skip to content

Commit 0c8d45c

Browse files
author
Dmytro Voskoboinikov
committed
Merge branch '2.3-develop' into MAGETWO-89540
2 parents a377229 + b16dfc6 commit 0c8d45c

File tree

392 files changed

+11726
-4250
lines changed

Some content is hidden

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

392 files changed

+11726
-4250
lines changed

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ env:
2222
global:
2323
- COMPOSER_BIN_DIR=~/bin
2424
- INTEGRATION_SETS=3
25-
- NODE_JS_VERSION=6
25+
- NODE_JS_VERSION=8
2626
- MAGENTO_HOST_NAME="magento2.travis"
2727
matrix:
2828
- TEST_SUITE=unit

COPYING.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Copyright © 2013-2018 Magento, Inc.
1+
Copyright © 2013-present Magento, Inc.
22

33
Each Magento source file included in this distribution is licensed under OSL 3.0 or the Magento Enterprise Edition (MEE) license
44

app/code/Magento/AdvancedSearch/Model/ResourceModel/Index.php

Lines changed: 23 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,10 @@
1010
use Magento\Framework\Model\ResourceModel\Db\Context;
1111
use Magento\Framework\EntityManager\MetadataPool;
1212
use Magento\Catalog\Api\Data\CategoryInterface;
13+
use Magento\Framework\App\ObjectManager;
14+
use Magento\Framework\Indexer\ScopeResolver\IndexScopeResolver as TableResolver;
15+
use Magento\Framework\Search\Request\Dimension;
16+
use Magento\Catalog\Model\Indexer\Category\Product\AbstractAction;
1317

1418
/**
1519
* @api
@@ -29,22 +33,30 @@ class Index extends AbstractDb
2933
*/
3034
protected $metadataPool;
3135

36+
/**
37+
* @var TableResolver
38+
*/
39+
private $tableResolver;
40+
3241
/**
3342
* Index constructor.
3443
* @param Context $context
3544
* @param StoreManagerInterface $storeManager
3645
* @param MetadataPool $metadataPool
3746
* @param null $connectionName
47+
* @param TableResolver|null $tableResolver
3848
*/
3949
public function __construct(
4050
Context $context,
4151
StoreManagerInterface $storeManager,
4252
MetadataPool $metadataPool,
43-
$connectionName = null
53+
$connectionName = null,
54+
TableResolver $tableResolver = null
4455
) {
4556
parent::__construct($context, $connectionName);
4657
$this->storeManager = $storeManager;
4758
$this->metadataPool = $metadataPool;
59+
$this->tableResolver = $tableResolver ?: ObjectManager::getInstance()->get(TableResolver::class);
4860
}
4961

5062
/**
@@ -116,8 +128,17 @@ public function getCategoryProductIndexData($storeId = null, $productIds = null)
116128
{
117129
$connection = $this->getConnection();
118130

131+
$catalogCategoryProductDimension = new Dimension(\Magento\Store\Model\Store::ENTITY, $storeId);
132+
133+
$catalogCategoryProductTableName = $this->tableResolver->resolve(
134+
AbstractAction::MAIN_INDEX_TABLE,
135+
[
136+
$catalogCategoryProductDimension
137+
]
138+
);
139+
119140
$select = $connection->select()->from(
120-
[$this->getTable('catalog_category_product_index')],
141+
[$catalogCategoryProductTableName],
121142
['category_id', 'product_id', 'position', 'store_id']
122143
)->where(
123144
'store_id = ?',

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,14 @@
1717
Your reports can be accessed securely on a personalized dashboard outside of the admin panel by clicking on the
1818
"Go to Advanced Reporting" link. </br> For more information, see our <a href="https://magento.com/legal/terms/cloud-terms">
1919
terms and conditions</a>.]]></comment>
20-
<field id="enabled" translate="label comment" type="select" sortOrder="10" showInDefault="1" showInWebsite="0" showInStore="0">
20+
<field id="enabled" translate="label" type="select" sortOrder="10" showInDefault="1" showInWebsite="0" showInStore="0">
2121
<label>Advanced Reporting Service</label>
2222
<source_model>Magento\Config\Model\Config\Source\Enabledisable</source_model>
2323
<backend_model>Magento\Analytics\Model\Config\Backend\Enabled</backend_model>
2424
<frontend_model>Magento\Analytics\Block\Adminhtml\System\Config\SubscriptionStatusLabel</frontend_model>
2525
<config_path>analytics/subscription/enabled</config_path>
2626
</field>
27-
<field id="collection_time" translate="label comment" type="time" sortOrder="20" showInDefault="1" showInWebsite="0" showInStore="0">
27+
<field id="collection_time" translate="label" type="time" sortOrder="20" showInDefault="1" showInWebsite="0" showInStore="0">
2828
<label>Time of day to send data</label>
2929
<frontend_model>Magento\Analytics\Block\Adminhtml\System\Config\CollectionTimeLabel</frontend_model>
3030
<backend_model>Magento\Analytics\Model\Config\Backend\CollectionTime</backend_model>

app/code/Magento/Backend/view/adminhtml/web/js/media-uploader.js

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,19 @@ define([
1313
'jquery',
1414
'mage/template',
1515
'Magento_Ui/js/modal/alert',
16+
'Magento_Ui/js/form/element/file-uploader',
1617
'mage/translate',
1718
'jquery/file-uploader'
18-
], function ($, mageTemplate, alert) {
19+
], function ($, mageTemplate, alert, FileUploader) {
1920
'use strict';
2021

22+
var fileUploader = new FileUploader({
23+
dataScope: '',
24+
isMultipleFiles: true
25+
});
26+
27+
fileUploader.initUploader();
28+
2129
$.widget('mage.mediaUploader', {
2230

2331
/**
@@ -79,10 +87,9 @@ define([
7987
if (data.result && !data.result.error) {
8088
self.element.trigger('addItem', data.result);
8189
} else {
82-
alert({
83-
content: $.mage.__('We don\'t recognize or support this file extension type.')
84-
});
90+
fileUploader.aggregateError(data.files[0].name, data.result.error);
8591
}
92+
8693
self.element.find('#' + data.fileId).remove();
8794
},
8895

@@ -108,7 +115,9 @@ define([
108115
.delay(2000)
109116
.hide('highlight')
110117
.remove();
111-
}
118+
},
119+
120+
stop: fileUploader.uploaderConfig.stop
112121
});
113122

114123
this.element.find('input[type=file]').fileupload('option', {
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
<?php
2+
/**
3+
* Copyright © Magento, Inc. All rights reserved.
4+
* See COPYING.txt for license details.
5+
*/
6+
declare(strict_types=1);
7+
8+
namespace Magento\Braintree\Gateway\Validator;
9+
10+
use Braintree\Error\ErrorCollection;
11+
use Braintree\Error\Validation;
12+
use Braintree\Result\Error;
13+
use Braintree\Result\Successful;
14+
15+
/**
16+
* Processes errors codes from Braintree response.
17+
*/
18+
class ErrorCodeProvider
19+
{
20+
/**
21+
* Retrieves list of error codes from Braintree response.
22+
*
23+
* @param Successful|Error $response
24+
* @return array
25+
*/
26+
public function getErrorCodes($response): array
27+
{
28+
$result = [];
29+
if (!$response instanceof Error) {
30+
return $result;
31+
}
32+
33+
/** @var ErrorCollection $collection */
34+
$collection = $response->errors;
35+
36+
/** @var Validation $error */
37+
foreach ($collection->deepAll() as $error) {
38+
$result[] = $error->code;
39+
}
40+
41+
return $result;
42+
}
43+
}

app/code/Magento/Braintree/Gateway/Validator/GeneralResponseValidator.php

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,16 +18,26 @@ class GeneralResponseValidator extends AbstractValidator
1818
*/
1919
protected $subjectReader;
2020

21+
/**
22+
* @var ErrorCodeProvider
23+
*/
24+
private $errorCodeProvider;
25+
2126
/**
2227
* Constructor
2328
*
2429
* @param ResultInterfaceFactory $resultFactory
2530
* @param SubjectReader $subjectReader
31+
* @param ErrorCodeProvider $errorCodeProvider
2632
*/
27-
public function __construct(ResultInterfaceFactory $resultFactory, SubjectReader $subjectReader)
28-
{
33+
public function __construct(
34+
ResultInterfaceFactory $resultFactory,
35+
SubjectReader $subjectReader,
36+
ErrorCodeProvider $errorCodeProvider
37+
) {
2938
parent::__construct($resultFactory);
3039
$this->subjectReader = $subjectReader;
40+
$this->errorCodeProvider = $errorCodeProvider;
3141
}
3242

3343
/**
@@ -49,8 +59,9 @@ public function validate(array $validationSubject)
4959
$errorMessages = array_merge($errorMessages, $validationResult[1]);
5060
}
5161
}
62+
$errorCodes = $this->errorCodeProvider->getErrorCodes($response);
5263

53-
return $this->createResult($isValid, $errorMessages);
64+
return $this->createResult($isValid, $errorMessages, $errorCodes);
5465
}
5566

5667
/**
@@ -62,7 +73,7 @@ protected function getResponseValidators()
6273
function ($response) {
6374
return [
6475
property_exists($response, 'success') && $response->success === true,
65-
[__('Braintree error response.')]
76+
[$response->message ?? __('Braintree error response.')]
6677
];
6778
}
6879
];

app/code/Magento/Braintree/Model/Adminhtml/System/Config/CountryCreditCard.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,13 @@ public function __construct(
6666
public function beforeSave()
6767
{
6868
$value = $this->getValue();
69+
if (!is_array($value)) {
70+
try {
71+
$value = $this->serializer->unserialize($value);
72+
} catch (\InvalidArgumentException $e) {
73+
$value = [];
74+
}
75+
}
6976
$result = [];
7077
foreach ($value as $data) {
7178
if (empty($data['country_id']) || empty($data['cc_types'])) {

app/code/Magento/Braintree/Test/Unit/Gateway/Command/GetPaymentNonceCommandTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ protected function setUp()
9999
->getMock();
100100

101101
$this->validationResultMock = $this->getMockBuilder(ResultInterface::class)
102-
->setMethods(['isValid', 'getFailsDescription'])
102+
->setMethods(['isValid', 'getFailsDescription', 'getErrorCodes'])
103103
->getMock();
104104

105105
$this->responseValidatorMock = $this->getMockBuilder(PaymentNonceResponseValidator::class)

0 commit comments

Comments
 (0)