Skip to content

Commit

Permalink
Merge pull request #2 from magento/2.3-develop
Browse files Browse the repository at this point in the history
2.3 develop
  • Loading branch information
ktpl-prakash authored Sep 8, 2018
2 parents 6116023 + 1a752a5 commit 97d5e9b
Show file tree
Hide file tree
Showing 1,577 changed files with 29,765 additions and 13,806 deletions.
12 changes: 10 additions & 2 deletions app/bootstrap.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,16 @@
&& isset($_SERVER['HTTP_ACCEPT'])
&& strpos($_SERVER['HTTP_ACCEPT'], 'text/html') !== false
) {
\Magento\Framework\Profiler::applyConfig(
(isset($_SERVER['MAGE_PROFILER']) && strlen($_SERVER['MAGE_PROFILER'])) ? $_SERVER['MAGE_PROFILER'] : trim(file_get_contents(BP . '/var/profiler.flag')),
$profilerConfig = isset($_SERVER['MAGE_PROFILER']) && strlen($_SERVER['MAGE_PROFILER'])
? $_SERVER['MAGE_PROFILER']
: trim(file_get_contents(BP . '/var/profiler.flag'));

if ($profilerConfig) {
$profilerConfig = json_decode($profilerConfig, true) ?: $profilerConfig;
}

Magento\Framework\Profiler::applyConfig(
$profilerConfig,
BP,
!empty($_SERVER['HTTP_X_REQUESTED_WITH']) && $_SERVER['HTTP_X_REQUESTED_WITH'] == 'XMLHttpRequest'
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public function __construct(
}

/**
* Predispath admin action controller
* Predispatch admin action controller
*
* @param \Magento\Framework\Event\Observer $observer
* @return void
Expand Down
2 changes: 1 addition & 1 deletion app/code/Magento/AdminNotification/etc/adminhtml/menu.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@
-->
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Backend:etc/menu.xsd">
<menu>
<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"/>
<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"/>
</menu>
</config>
56 changes: 28 additions & 28 deletions app/code/Magento/AdminNotification/etc/db_schema_whitelist.json
Original file line number Diff line number Diff line change
@@ -1,32 +1,32 @@
{
"adminnotification_inbox": {
"column": {
"notification_id": true,
"severity": true,
"date_added": true,
"title": true,
"description": true,
"url": true,
"is_read": true,
"is_remove": true
"adminnotification_inbox": {
"column": {
"notification_id": true,
"severity": true,
"date_added": true,
"title": true,
"description": true,
"url": true,
"is_read": true,
"is_remove": true
},
"index": {
"ADMINNOTIFICATION_INBOX_SEVERITY": true,
"ADMINNOTIFICATION_INBOX_IS_READ": true,
"ADMINNOTIFICATION_INBOX_IS_REMOVE": true
},
"constraint": {
"PRIMARY": true
}
},
"index": {
"ADMINNOTIFICATION_INBOX_SEVERITY": true,
"ADMINNOTIFICATION_INBOX_IS_READ": true,
"ADMINNOTIFICATION_INBOX_IS_REMOVE": true
},
"constraint": {
"PRIMARY": true
}
},
"admin_system_messages": {
"column": {
"identity": true,
"severity": true,
"created_at": true
},
"constraint": {
"PRIMARY": true
"admin_system_messages": {
"column": {
"identity": true,
"severity": true,
"created_at": true
},
"constraint": {
"PRIMARY": true
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,10 @@ public function execute()
);
return $resultLayout;
} catch (\Exception $e) {
$this->messageManager->addError($e->getMessage());
$this->messageManager->addErrorMessage($e->getMessage());
}
} else {
$this->messageManager->addError(__('Please correct the data sent.'));
$this->messageManager->addErrorMessage(__('Please correct the data sent.'));
}
/** @var \Magento\Backend\Model\View\Result\Redirect $resultRedirect */
$resultRedirect = $this->resultFactory->create(ResultFactory::TYPE_REDIRECT);
Expand Down
30 changes: 22 additions & 8 deletions app/code/Magento/AdvancedSearch/Model/ResourceModel/Index.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
use Magento\Catalog\Model\Indexer\Category\Product\AbstractAction;
use Magento\Framework\Search\Request\IndexScopeResolverInterface as TableResolver;
use Magento\Catalog\Model\Indexer\Product\Price\DimensionCollectionFactory;
use Magento\Store\Model\Indexer\WebsiteDimensionProvider;

/**
* @api
Expand Down Expand Up @@ -47,12 +48,17 @@ class Index extends AbstractDb
*/
private $dimensionCollectionFactory;

/**
* @var int|null
*/
private $websiteId;

/**
* Index constructor.
* @param Context $context
* @param StoreManagerInterface $storeManager
* @param MetadataPool $metadataPool
* @param null $connectionName
* @param string|null $connectionName
* @param TableResolver|null $tableResolver
* @param DimensionCollectionFactory|null $dimensionCollectionFactory
*/
Expand Down Expand Up @@ -94,12 +100,17 @@ protected function _getCatalogProductPriceData($productIds = null)
$catalogProductIndexPriceSelect = [];

foreach ($this->dimensionCollectionFactory->create() as $dimensions) {
$catalogProductIndexPriceSelect[] = $connection->select()->from(
$this->tableResolver->resolve('catalog_product_index_price', $dimensions),
['entity_id', 'customer_group_id', 'website_id', 'min_price']
);
if ($productIds) {
current($catalogProductIndexPriceSelect)->where('entity_id IN (?)', $productIds);
if (!isset($dimensions[WebsiteDimensionProvider::DIMENSION_NAME]) ||
$this->websiteId === null ||
$dimensions[WebsiteDimensionProvider::DIMENSION_NAME]->getValue() === $this->websiteId) {
$select = $connection->select()->from(
$this->tableResolver->resolve('catalog_product_index_price', $dimensions),
['entity_id', 'customer_group_id', 'website_id', 'min_price']
);
if ($productIds) {
$select->where('entity_id IN (?)', $productIds);
}
$catalogProductIndexPriceSelect[] = $select;
}
}

Expand All @@ -123,9 +134,12 @@ protected function _getCatalogProductPriceData($productIds = null)
*/
public function getPriceIndexData($productIds, $storeId)
{
$websiteId = $this->storeManager->getStore($storeId)->getWebsiteId();

$this->websiteId = $websiteId;
$priceProductsIndexData = $this->_getCatalogProductPriceData($productIds);
$this->websiteId = null;

$websiteId = $this->storeManager->getStore($storeId)->getWebsiteId();
if (!isset($priceProductsIndexData[$websiteId])) {
return [];
}
Expand Down
22 changes: 11 additions & 11 deletions app/code/Magento/AdvancedSearch/etc/db_schema_whitelist.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
{
"catalogsearch_recommendations": {
"column": {
"id": true,
"query_id": true,
"relation_id": true
},
"constraint": {
"PRIMARY": true,
"CATALOGSEARCH_RECOMMENDATIONS_QUERY_ID_SEARCH_QUERY_QUERY_ID": true,
"CATALOGSEARCH_RECOMMENDATIONS_RELATION_ID_SEARCH_QUERY_QUERY_ID": true
"catalogsearch_recommendations": {
"column": {
"id": true,
"query_id": true,
"relation_id": true
},
"constraint": {
"PRIMARY": true,
"CATALOGSEARCH_RECOMMENDATIONS_QUERY_ID_SEARCH_QUERY_QUERY_ID": true,
"CATALOGSEARCH_RECOMMENDATIONS_RELATION_ID_SEARCH_QUERY_QUERY_ID": true
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,9 @@ public function toBody(array $data);
* @return string
*/
public function getContentTypeHeader();

/**
* @return string
*/
public function getContentMediaType(): string;
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
declare(strict_types=1);

namespace Magento\Analytics\Model\Connector\Http;

use Magento\Framework\Serialize\Serializer\Json;
Expand All @@ -14,9 +16,16 @@ class JsonConverter implements ConverterInterface
{
/**
* Content-Type HTTP header for json.
* @deprecated
* @see CONTENT_MEDIA_TYPE
*/
const CONTENT_TYPE_HEADER = 'Content-Type: application/json';

/**
* Media-Type corresponding to this converter.
*/
const CONTENT_MEDIA_TYPE = 'application/json';

/**
* @var Json
*/
Expand Down Expand Up @@ -56,6 +65,14 @@ public function toBody(array $data)
*/
public function getContentTypeHeader()
{
return self::CONTENT_TYPE_HEADER;
return sprintf('Content-Type: %s', self::CONTENT_MEDIA_TYPE);
}

/**
* @inheritdoc
*/
public function getContentMediaType(): string
{
return self::CONTENT_MEDIA_TYPE;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,15 @@ public function __construct(ConverterInterface $converter, array $responseHandle
public function getResult(\Zend_Http_Response $response)
{
$result = false;
$responseBody = $this->converter->fromBody($response->getBody());
$converterMediaType = $this->converter->getContentMediaType();

/** Content-Type header may not only contain media-type declaration */
if ($response->getBody() && is_int(strripos($response->getHeader('Content-Type'), $converterMediaType))) {
$responseBody = $this->converter->fromBody($response->getBody());
} else {
$responseBody = [];
}

if (array_key_exists($response->getStatus(), $this->responseHandlers)) {
$result = $this->responseHandlers[$response->getStatus()]->handleResponse($responseBody);
}
Expand Down
5 changes: 3 additions & 2 deletions app/code/Magento/Analytics/Model/Connector/OTPRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -103,8 +103,9 @@ public function call()
if (!$result) {
$this->logger->warning(
sprintf(
'Obtaining of an OTP from the MBI service has been failed: %s',
!empty($response->getBody()) ? $response->getBody() : 'Response body is empty.'
'Obtaining of an OTP from the MBI service has been failed: %s. Content-Type: %s',
!empty($response->getBody()) ? $response->getBody() : 'Response body is empty',
$response->getHeader('Content-Type')
)
);
}
Expand Down
6 changes: 4 additions & 2 deletions app/code/Magento/Analytics/Model/Connector/SignUpCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -110,8 +110,10 @@ public function execute()
if (!$result) {
$this->logger->warning(
sprintf(
'Subscription for MBI service has been failed. An error occurred during token exchange: %s',
!empty($response->getBody()) ? $response->getBody() : 'Response body is empty.'
'Subscription for MBI service has been failed. An error occurred during token exchange: %s.'
. ' Content-Type: %s',
!empty($response->getBody()) ? $response->getBody() : 'Response body is empty',
$response->getHeader('Content-Type')
)
);
}
Expand Down
5 changes: 3 additions & 2 deletions app/code/Magento/Analytics/Model/Connector/UpdateCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -101,8 +101,9 @@ public function execute()
if (!$result) {
$this->logger->warning(
sprintf(
'Update of the subscription for MBI service has been failed: %s',
!empty($response->getBody()) ? $response->getBody() : 'Response body is empty.'
'Update of the subscription for MBI service has been failed: %s. Content-Type: %s',
!empty($response->getBody()) ? $response->getBody() : 'Response body is empty',
$response->getHeader('Content-Type')
)
);
}
Expand Down
2 changes: 1 addition & 1 deletion app/code/Magento/Analytics/Test/Mftf/Data/UserData.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
-->

<entities xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="../../../../../../../dev/tests/acceptance/vendor/magento/magento2-functional-testing-framework/src/Magento/FunctionalTestingFramework/DataGenerator/etc/dataProfileSchema.xsd">
xsi:noNamespaceSchemaLocation="urn:magento:mftf:DataGenerator/etc/dataProfileSchema.xsd">
<entity name="adminNoReport" type="user">
<data key="username" unique="suffix">noreport</data>
<data key="firstname">No</data>
Expand Down
2 changes: 1 addition & 1 deletion app/code/Magento/Analytics/Test/Mftf/Data/UserRoleData.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
-->

<entities xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="../../../../../../../dev/tests/acceptance/vendor/magento/magento2-functional-testing-framework/src/Magento/FunctionalTestingFramework/DataGenerator/etc/dataProfileSchema.xsd">
xsi:noNamespaceSchemaLocation="urn:magento:mftf:DataGenerator/etc/dataProfileSchema.xsd">
<entity name="adminNoReportRole" type="user_role">
<data key="rolename" unique="suffix">noreport</data>
<data key="current_password">123123q</data>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
*/
-->
<operations xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="../../../../../../../dev/tests/acceptance/vendor/magento/magento2-functional-testing-framework/src/Magento/FunctionalTestingFramework/DataGenerator/etc/dataOperation.xsd">
xsi:noNamespaceSchemaLocation="urn:magento:mftf:DataGenerator/etc/dataOperation.xsd">
<operation name="CreateUser" dataType="user" type="create"
auth="adminFormKey" url="/admin/user/save/" method="POST" successRegex="/messages-message-success/" returnRegex="" >
<contentType>application/x-www-form-urlencoded</contentType>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
*/
-->
<operations xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="../../../../../../../dev/tests/acceptance/vendor/magento/magento2-functional-testing-framework/src/Magento/FunctionalTestingFramework/DataGenerator/etc/dataOperation.xsd">
xsi:noNamespaceSchemaLocation="urn:magento:mftf:DataGenerator/etc/dataOperation.xsd">
<operation name="CreateUserRole" dataType="user_role" type="create"
auth="adminFormKey" url="/admin/user_role/saverole/" method="POST" successRegex="/messages-message-success/" returnRegex="" >
<contentType>application/x-www-form-urlencoded</contentType>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
*/
-->
<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">
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd">
<test name="AdminConfigurationBlankIndustryTest">
<annotations>
<features value="Analytics"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
*/
-->

<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">
<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd">
<test name="AdminConfigurationEnableDisableAnalyticsTest">
<annotations>
<features value="Analytics"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
-->

<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">
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd">
<test name="AdminConfigurationIndustryTest">
<annotations>
<features value="Analytics"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
-->

<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">
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd">
<test name="AdminConfigurationPermissionTest">
<annotations>
<features value="Analytics"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
-->

<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">
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd">
<test name="AdminConfigurationTimeToSendDataTest">
<annotations>
<features value="Analytics"/>
Expand Down
Loading

0 comments on commit 97d5e9b

Please sign in to comment.