Skip to content
This repository was archived by the owner on Apr 29, 2019. It is now read-only.

Commit 97d5e9b

Browse files
authored
Merge pull request #2 from magento/2.3-develop
2.3 develop
2 parents 6116023 + 1a752a5 commit 97d5e9b

File tree

1,577 files changed

+29765
-13806
lines changed

Some content is hidden

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

1,577 files changed

+29765
-13806
lines changed

app/bootstrap.php

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,16 @@
5454
&& isset($_SERVER['HTTP_ACCEPT'])
5555
&& strpos($_SERVER['HTTP_ACCEPT'], 'text/html') !== false
5656
) {
57-
\Magento\Framework\Profiler::applyConfig(
58-
(isset($_SERVER['MAGE_PROFILER']) && strlen($_SERVER['MAGE_PROFILER'])) ? $_SERVER['MAGE_PROFILER'] : trim(file_get_contents(BP . '/var/profiler.flag')),
57+
$profilerConfig = isset($_SERVER['MAGE_PROFILER']) && strlen($_SERVER['MAGE_PROFILER'])
58+
? $_SERVER['MAGE_PROFILER']
59+
: trim(file_get_contents(BP . '/var/profiler.flag'));
60+
61+
if ($profilerConfig) {
62+
$profilerConfig = json_decode($profilerConfig, true) ?: $profilerConfig;
63+
}
64+
65+
Magento\Framework\Profiler::applyConfig(
66+
$profilerConfig,
5967
BP,
6068
!empty($_SERVER['HTTP_X_REQUESTED_WITH']) && $_SERVER['HTTP_X_REQUESTED_WITH'] == 'XMLHttpRequest'
6169
);

app/code/Magento/AdminNotification/Observer/PredispatchAdminActionControllerObserver.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ public function __construct(
3737
}
3838

3939
/**
40-
* Predispath admin action controller
40+
* Predispatch admin action controller
4141
*
4242
* @param \Magento\Framework\Event\Observer $observer
4343
* @return void

app/code/Magento/AdminNotification/etc/adminhtml/menu.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,6 @@
77
-->
88
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Backend:etc/menu.xsd">
99
<menu>
10-
<add id="Magento_AdminNotification::system_adminnotification" title="Notifications" translate="title" module="Magento_AdminNotification" sortOrder="10" parent="Magento_Backend::system_other_settings" action="adminhtml/notification" resource="Magento_AdminNotification::adminnotification"/>
10+
<add id="Magento_AdminNotification::system_adminnotification" title="Notifications" translate="title" module="Magento_AdminNotification" sortOrder="10" parent="Magento_Backend::system_other_settings" action="adminhtml/notification" resource="Magento_AdminNotification::adminnotification"/>
1111
</menu>
1212
</config>
Lines changed: 28 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,32 @@
11
{
2-
"adminnotification_inbox": {
3-
"column": {
4-
"notification_id": true,
5-
"severity": true,
6-
"date_added": true,
7-
"title": true,
8-
"description": true,
9-
"url": true,
10-
"is_read": true,
11-
"is_remove": true
2+
"adminnotification_inbox": {
3+
"column": {
4+
"notification_id": true,
5+
"severity": true,
6+
"date_added": true,
7+
"title": true,
8+
"description": true,
9+
"url": true,
10+
"is_read": true,
11+
"is_remove": true
12+
},
13+
"index": {
14+
"ADMINNOTIFICATION_INBOX_SEVERITY": true,
15+
"ADMINNOTIFICATION_INBOX_IS_READ": true,
16+
"ADMINNOTIFICATION_INBOX_IS_REMOVE": true
17+
},
18+
"constraint": {
19+
"PRIMARY": true
20+
}
1221
},
13-
"index": {
14-
"ADMINNOTIFICATION_INBOX_SEVERITY": true,
15-
"ADMINNOTIFICATION_INBOX_IS_READ": true,
16-
"ADMINNOTIFICATION_INBOX_IS_REMOVE": true
17-
},
18-
"constraint": {
19-
"PRIMARY": true
20-
}
21-
},
22-
"admin_system_messages": {
23-
"column": {
24-
"identity": true,
25-
"severity": true,
26-
"created_at": true
27-
},
28-
"constraint": {
29-
"PRIMARY": true
22+
"admin_system_messages": {
23+
"column": {
24+
"identity": true,
25+
"severity": true,
26+
"created_at": true
27+
},
28+
"constraint": {
29+
"PRIMARY": true
30+
}
3031
}
31-
}
3232
}

app/code/Magento/AdvancedPricingImportExport/Controller/Adminhtml/Export/GetFilter.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,10 @@ public function execute()
3737
);
3838
return $resultLayout;
3939
} catch (\Exception $e) {
40-
$this->messageManager->addError($e->getMessage());
40+
$this->messageManager->addErrorMessage($e->getMessage());
4141
}
4242
} else {
43-
$this->messageManager->addError(__('Please correct the data sent.'));
43+
$this->messageManager->addErrorMessage(__('Please correct the data sent.'));
4444
}
4545
/** @var \Magento\Backend\Model\View\Result\Redirect $resultRedirect */
4646
$resultRedirect = $this->resultFactory->create(ResultFactory::TYPE_REDIRECT);

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

Lines changed: 22 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
use Magento\Catalog\Model\Indexer\Category\Product\AbstractAction;
1717
use Magento\Framework\Search\Request\IndexScopeResolverInterface as TableResolver;
1818
use Magento\Catalog\Model\Indexer\Product\Price\DimensionCollectionFactory;
19+
use Magento\Store\Model\Indexer\WebsiteDimensionProvider;
1920

2021
/**
2122
* @api
@@ -47,12 +48,17 @@ class Index extends AbstractDb
4748
*/
4849
private $dimensionCollectionFactory;
4950

51+
/**
52+
* @var int|null
53+
*/
54+
private $websiteId;
55+
5056
/**
5157
* Index constructor.
5258
* @param Context $context
5359
* @param StoreManagerInterface $storeManager
5460
* @param MetadataPool $metadataPool
55-
* @param null $connectionName
61+
* @param string|null $connectionName
5662
* @param TableResolver|null $tableResolver
5763
* @param DimensionCollectionFactory|null $dimensionCollectionFactory
5864
*/
@@ -94,12 +100,17 @@ protected function _getCatalogProductPriceData($productIds = null)
94100
$catalogProductIndexPriceSelect = [];
95101

96102
foreach ($this->dimensionCollectionFactory->create() as $dimensions) {
97-
$catalogProductIndexPriceSelect[] = $connection->select()->from(
98-
$this->tableResolver->resolve('catalog_product_index_price', $dimensions),
99-
['entity_id', 'customer_group_id', 'website_id', 'min_price']
100-
);
101-
if ($productIds) {
102-
current($catalogProductIndexPriceSelect)->where('entity_id IN (?)', $productIds);
103+
if (!isset($dimensions[WebsiteDimensionProvider::DIMENSION_NAME]) ||
104+
$this->websiteId === null ||
105+
$dimensions[WebsiteDimensionProvider::DIMENSION_NAME]->getValue() === $this->websiteId) {
106+
$select = $connection->select()->from(
107+
$this->tableResolver->resolve('catalog_product_index_price', $dimensions),
108+
['entity_id', 'customer_group_id', 'website_id', 'min_price']
109+
);
110+
if ($productIds) {
111+
$select->where('entity_id IN (?)', $productIds);
112+
}
113+
$catalogProductIndexPriceSelect[] = $select;
103114
}
104115
}
105116

@@ -123,9 +134,12 @@ protected function _getCatalogProductPriceData($productIds = null)
123134
*/
124135
public function getPriceIndexData($productIds, $storeId)
125136
{
137+
$websiteId = $this->storeManager->getStore($storeId)->getWebsiteId();
138+
139+
$this->websiteId = $websiteId;
126140
$priceProductsIndexData = $this->_getCatalogProductPriceData($productIds);
141+
$this->websiteId = null;
127142

128-
$websiteId = $this->storeManager->getStore($storeId)->getWebsiteId();
129143
if (!isset($priceProductsIndexData[$websiteId])) {
130144
return [];
131145
}
Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
{
2-
"catalogsearch_recommendations": {
3-
"column": {
4-
"id": true,
5-
"query_id": true,
6-
"relation_id": true
7-
},
8-
"constraint": {
9-
"PRIMARY": true,
10-
"CATALOGSEARCH_RECOMMENDATIONS_QUERY_ID_SEARCH_QUERY_QUERY_ID": true,
11-
"CATALOGSEARCH_RECOMMENDATIONS_RELATION_ID_SEARCH_QUERY_QUERY_ID": true
2+
"catalogsearch_recommendations": {
3+
"column": {
4+
"id": true,
5+
"query_id": true,
6+
"relation_id": true
7+
},
8+
"constraint": {
9+
"PRIMARY": true,
10+
"CATALOGSEARCH_RECOMMENDATIONS_QUERY_ID_SEARCH_QUERY_QUERY_ID": true,
11+
"CATALOGSEARCH_RECOMMENDATIONS_RELATION_ID_SEARCH_QUERY_QUERY_ID": true
12+
}
1213
}
13-
}
1414
}

app/code/Magento/Analytics/Model/Connector/Http/ConverterInterface.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,4 +30,9 @@ public function toBody(array $data);
3030
* @return string
3131
*/
3232
public function getContentTypeHeader();
33+
34+
/**
35+
* @return string
36+
*/
37+
public function getContentMediaType(): string;
3338
}

app/code/Magento/Analytics/Model/Connector/Http/JsonConverter.php

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
* Copyright © Magento, Inc. All rights reserved.
44
* See COPYING.txt for license details.
55
*/
6+
declare(strict_types=1);
7+
68
namespace Magento\Analytics\Model\Connector\Http;
79

810
use Magento\Framework\Serialize\Serializer\Json;
@@ -14,9 +16,16 @@ class JsonConverter implements ConverterInterface
1416
{
1517
/**
1618
* Content-Type HTTP header for json.
19+
* @deprecated
20+
* @see CONTENT_MEDIA_TYPE
1721
*/
1822
const CONTENT_TYPE_HEADER = 'Content-Type: application/json';
1923

24+
/**
25+
* Media-Type corresponding to this converter.
26+
*/
27+
const CONTENT_MEDIA_TYPE = 'application/json';
28+
2029
/**
2130
* @var Json
2231
*/
@@ -56,6 +65,14 @@ public function toBody(array $data)
5665
*/
5766
public function getContentTypeHeader()
5867
{
59-
return self::CONTENT_TYPE_HEADER;
68+
return sprintf('Content-Type: %s', self::CONTENT_MEDIA_TYPE);
69+
}
70+
71+
/**
72+
* @inheritdoc
73+
*/
74+
public function getContentMediaType(): string
75+
{
76+
return self::CONTENT_MEDIA_TYPE;
6077
}
6178
}

app/code/Magento/Analytics/Model/Connector/Http/ResponseResolver.php

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,15 @@ public function __construct(ConverterInterface $converter, array $responseHandle
3838
public function getResult(\Zend_Http_Response $response)
3939
{
4040
$result = false;
41-
$responseBody = $this->converter->fromBody($response->getBody());
41+
$converterMediaType = $this->converter->getContentMediaType();
42+
43+
/** Content-Type header may not only contain media-type declaration */
44+
if ($response->getBody() && is_int(strripos($response->getHeader('Content-Type'), $converterMediaType))) {
45+
$responseBody = $this->converter->fromBody($response->getBody());
46+
} else {
47+
$responseBody = [];
48+
}
49+
4250
if (array_key_exists($response->getStatus(), $this->responseHandlers)) {
4351
$result = $this->responseHandlers[$response->getStatus()]->handleResponse($responseBody);
4452
}

app/code/Magento/Analytics/Model/Connector/OTPRequest.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -103,8 +103,9 @@ public function call()
103103
if (!$result) {
104104
$this->logger->warning(
105105
sprintf(
106-
'Obtaining of an OTP from the MBI service has been failed: %s',
107-
!empty($response->getBody()) ? $response->getBody() : 'Response body is empty.'
106+
'Obtaining of an OTP from the MBI service has been failed: %s. Content-Type: %s',
107+
!empty($response->getBody()) ? $response->getBody() : 'Response body is empty',
108+
$response->getHeader('Content-Type')
108109
)
109110
);
110111
}

app/code/Magento/Analytics/Model/Connector/SignUpCommand.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -110,8 +110,10 @@ public function execute()
110110
if (!$result) {
111111
$this->logger->warning(
112112
sprintf(
113-
'Subscription for MBI service has been failed. An error occurred during token exchange: %s',
114-
!empty($response->getBody()) ? $response->getBody() : 'Response body is empty.'
113+
'Subscription for MBI service has been failed. An error occurred during token exchange: %s.'
114+
. ' Content-Type: %s',
115+
!empty($response->getBody()) ? $response->getBody() : 'Response body is empty',
116+
$response->getHeader('Content-Type')
115117
)
116118
);
117119
}

app/code/Magento/Analytics/Model/Connector/UpdateCommand.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,8 +101,9 @@ public function execute()
101101
if (!$result) {
102102
$this->logger->warning(
103103
sprintf(
104-
'Update of the subscription for MBI service has been failed: %s',
105-
!empty($response->getBody()) ? $response->getBody() : 'Response body is empty.'
104+
'Update of the subscription for MBI service has been failed: %s. Content-Type: %s',
105+
!empty($response->getBody()) ? $response->getBody() : 'Response body is empty',
106+
$response->getHeader('Content-Type')
106107
)
107108
);
108109
}

app/code/Magento/Analytics/Test/Mftf/Data/UserData.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
-->
88

99
<entities xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10-
xsi:noNamespaceSchemaLocation="../../../../../../../dev/tests/acceptance/vendor/magento/magento2-functional-testing-framework/src/Magento/FunctionalTestingFramework/DataGenerator/etc/dataProfileSchema.xsd">
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:DataGenerator/etc/dataProfileSchema.xsd">
1111
<entity name="adminNoReport" type="user">
1212
<data key="username" unique="suffix">noreport</data>
1313
<data key="firstname">No</data>

app/code/Magento/Analytics/Test/Mftf/Data/UserRoleData.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
-->
88

99
<entities xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10-
xsi:noNamespaceSchemaLocation="../../../../../../../dev/tests/acceptance/vendor/magento/magento2-functional-testing-framework/src/Magento/FunctionalTestingFramework/DataGenerator/etc/dataProfileSchema.xsd">
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:DataGenerator/etc/dataProfileSchema.xsd">
1111
<entity name="adminNoReportRole" type="user_role">
1212
<data key="rolename" unique="suffix">noreport</data>
1313
<data key="current_password">123123q</data>

app/code/Magento/Analytics/Test/Mftf/Metadata/user-meta.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
*/
77
-->
88
<operations xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
9-
xsi:noNamespaceSchemaLocation="../../../../../../../dev/tests/acceptance/vendor/magento/magento2-functional-testing-framework/src/Magento/FunctionalTestingFramework/DataGenerator/etc/dataOperation.xsd">
9+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:DataGenerator/etc/dataOperation.xsd">
1010
<operation name="CreateUser" dataType="user" type="create"
1111
auth="adminFormKey" url="/admin/user/save/" method="POST" successRegex="/messages-message-success/" returnRegex="" >
1212
<contentType>application/x-www-form-urlencoded</contentType>

app/code/Magento/Analytics/Test/Mftf/Metadata/user_role-meta.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
*/
77
-->
88
<operations xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
9-
xsi:noNamespaceSchemaLocation="../../../../../../../dev/tests/acceptance/vendor/magento/magento2-functional-testing-framework/src/Magento/FunctionalTestingFramework/DataGenerator/etc/dataOperation.xsd">
9+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:DataGenerator/etc/dataOperation.xsd">
1010
<operation name="CreateUserRole" dataType="user_role" type="create"
1111
auth="adminFormKey" url="/admin/user_role/saverole/" method="POST" successRegex="/messages-message-success/" returnRegex="" >
1212
<contentType>application/x-www-form-urlencoded</contentType>

app/code/Magento/Analytics/Test/Mftf/Test/AdminConfigurationBlankIndustryTest.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
*/
77
-->
88
<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
9-
xsi:noNamespaceSchemaLocation="../../../../../../../dev/tests/acceptance/vendor/magento/magento2-functional-testing-framework/src/Magento/FunctionalTestingFramework/Test/etc/testSchema.xsd">
9+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd">
1010
<test name="AdminConfigurationBlankIndustryTest">
1111
<annotations>
1212
<features value="Analytics"/>

app/code/Magento/Analytics/Test/Mftf/Test/AdminConfigurationEnableDisableAnalyticsTest.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
*/
77
-->
88

9-
<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../dev/tests/acceptance/vendor/magento/magento2-functional-testing-framework/src/Magento/FunctionalTestingFramework/Test/etc/testSchema.xsd">
9+
<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd">
1010
<test name="AdminConfigurationEnableDisableAnalyticsTest">
1111
<annotations>
1212
<features value="Analytics"/>

app/code/Magento/Analytics/Test/Mftf/Test/AdminConfigurationIndustryTest.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
-->
88

99
<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10-
xsi:noNamespaceSchemaLocation="../../../../../../../dev/tests/acceptance/vendor/magento/magento2-functional-testing-framework/src/Magento/FunctionalTestingFramework/Test/etc/testSchema.xsd">
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd">
1111
<test name="AdminConfigurationIndustryTest">
1212
<annotations>
1313
<features value="Analytics"/>

app/code/Magento/Analytics/Test/Mftf/Test/AdminConfigurationPermissionTest.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
-->
88

99
<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10-
xsi:noNamespaceSchemaLocation="../../../../../../../dev/tests/acceptance/vendor/magento/magento2-functional-testing-framework/src/Magento/FunctionalTestingFramework/Test/etc/testSchema.xsd">
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd">
1111
<test name="AdminConfigurationPermissionTest">
1212
<annotations>
1313
<features value="Analytics"/>

app/code/Magento/Analytics/Test/Mftf/Test/AdminConfigurationTimeToSendDataTest.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
-->
88

99
<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10-
xsi:noNamespaceSchemaLocation="../../../../../../../dev/tests/acceptance/vendor/magento/magento2-functional-testing-framework/src/Magento/FunctionalTestingFramework/Test/etc/testSchema.xsd">
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd">
1111
<test name="AdminConfigurationTimeToSendDataTest">
1212
<annotations>
1313
<features value="Analytics"/>

0 commit comments

Comments
 (0)