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

Commit a2993a5

Browse files
authored
Merge pull request #15 from magento/2.3-develop
2.3 develop
2 parents 92c1aa4 + a04f913 commit a2993a5

File tree

1,744 files changed

+48096
-23390
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,744 files changed

+48096
-23390
lines changed

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1977,7 +1977,7 @@ Tests:
19771977
* [#686](https://github.com/magento/magento2/issues/686) -- Product save validation errors in the admin don't hide the overlay
19781978
* [#702](https://github.com/magento/magento2/issues/702) -- Base table or view not found
19791979
* [#652](https://github.com/magento/magento2/issues/652) -- Multishipping checkout not to change the Billing address js issue
1980-
* [#648](https://github.com/magento/magento2/issues/648) -- An equal (=) sign in the hash of the product page to to break the tabs functionality
1980+
* [#648](https://github.com/magento/magento2/issues/648) -- An equal (=) sign in the hash of the product page to break the tabs functionality
19811981
* Service Contracts:
19821982
* Refactored usage of new API of the Customer module
19831983
* Implemented Service Contracts for the Sales module

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/Test/Mftf/composer.json

Lines changed: 0 additions & 20 deletions
This file was deleted.

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/Test/Mftf/composer.json

Lines changed: 0 additions & 23 deletions
This file was deleted.

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

Lines changed: 45 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -6,18 +6,23 @@
66
namespace Magento\AdvancedSearch\Model\ResourceModel;
77

88
use Magento\Framework\Model\ResourceModel\Db\AbstractDb;
9+
use Magento\Framework\Search\Request\IndexScopeResolverInterface;
910
use Magento\Store\Model\StoreManagerInterface;
1011
use Magento\Framework\Model\ResourceModel\Db\Context;
1112
use Magento\Framework\EntityManager\MetadataPool;
1213
use Magento\Catalog\Api\Data\CategoryInterface;
1314
use Magento\Framework\App\ObjectManager;
14-
use Magento\Framework\Indexer\ScopeResolver\IndexScopeResolver as TableResolver;
1515
use Magento\Framework\Search\Request\Dimension;
1616
use Magento\Catalog\Model\Indexer\Category\Product\AbstractAction;
17+
use Magento\Framework\Search\Request\IndexScopeResolverInterface as TableResolver;
18+
use Magento\Catalog\Model\Indexer\Product\Price\DimensionCollectionFactory;
19+
use Magento\Store\Model\Indexer\WebsiteDimensionProvider;
1720

1821
/**
1922
* @api
2023
* @since 100.1.0
24+
*
25+
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
2126
*/
2227
class Index extends AbstractDb
2328
{
@@ -38,25 +43,39 @@ class Index extends AbstractDb
3843
*/
3944
private $tableResolver;
4045

46+
/**
47+
* @var DimensionCollectionFactory|null
48+
*/
49+
private $dimensionCollectionFactory;
50+
51+
/**
52+
* @var int|null
53+
*/
54+
private $websiteId;
55+
4156
/**
4257
* Index constructor.
4358
* @param Context $context
4459
* @param StoreManagerInterface $storeManager
4560
* @param MetadataPool $metadataPool
46-
* @param null $connectionName
61+
* @param string|null $connectionName
4762
* @param TableResolver|null $tableResolver
63+
* @param DimensionCollectionFactory|null $dimensionCollectionFactory
4864
*/
4965
public function __construct(
5066
Context $context,
5167
StoreManagerInterface $storeManager,
5268
MetadataPool $metadataPool,
5369
$connectionName = null,
54-
TableResolver $tableResolver = null
70+
TableResolver $tableResolver = null,
71+
DimensionCollectionFactory $dimensionCollectionFactory = null
5572
) {
5673
parent::__construct($context, $connectionName);
5774
$this->storeManager = $storeManager;
5875
$this->metadataPool = $metadataPool;
59-
$this->tableResolver = $tableResolver ?: ObjectManager::getInstance()->get(TableResolver::class);
76+
$this->tableResolver = $tableResolver ?: ObjectManager::getInstance()->get(IndexScopeResolverInterface::class);
77+
$this->dimensionCollectionFactory = $dimensionCollectionFactory
78+
?: ObjectManager::getInstance()->get(DimensionCollectionFactory::class);
6079
}
6180

6281
/**
@@ -78,18 +97,27 @@ protected function _construct()
7897
protected function _getCatalogProductPriceData($productIds = null)
7998
{
8099
$connection = $this->getConnection();
81-
82-
$select = $connection->select()->from(
83-
$this->getTable('catalog_product_index_price'),
84-
['entity_id', 'customer_group_id', 'website_id', 'min_price']
85-
);
86-
87-
if ($productIds) {
88-
$select->where('entity_id IN (?)', $productIds);
100+
$catalogProductIndexPriceSelect = [];
101+
102+
foreach ($this->dimensionCollectionFactory->create() as $dimensions) {
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;
114+
}
89115
}
90116

117+
$catalogProductIndexPriceUnionSelect = $connection->select()->union($catalogProductIndexPriceSelect);
118+
91119
$result = [];
92-
foreach ($connection->fetchAll($select) as $row) {
120+
foreach ($connection->fetchAll($catalogProductIndexPriceUnionSelect) as $row) {
93121
$result[$row['website_id']][$row['entity_id']][$row['customer_group_id']] = round($row['min_price'], 2);
94122
}
95123

@@ -106,9 +134,12 @@ protected function _getCatalogProductPriceData($productIds = null)
106134
*/
107135
public function getPriceIndexData($productIds, $storeId)
108136
{
137+
$websiteId = $this->storeManager->getStore($storeId)->getWebsiteId();
138+
139+
$this->websiteId = $websiteId;
109140
$priceProductsIndexData = $this->_getCatalogProductPriceData($productIds);
141+
$this->websiteId = null;
110142

111-
$websiteId = $this->storeManager->getStore($storeId)->getWebsiteId();
112143
if (!isset($priceProductsIndexData[$websiteId])) {
113144
return [];
114145
}

app/code/Magento/AdvancedSearch/Test/Mftf/composer.json

Lines changed: 0 additions & 22 deletions
This file was deleted.

app/code/Magento/AdvancedSearch/Test/Unit/Model/ResourceModel/IndexTest.php

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,9 @@
1515
use Magento\Framework\App\ResourceConnection;
1616
use Magento\Framework\DB\Select;
1717

18+
/**
19+
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
20+
*/
1821
class IndexTest extends \PHPUnit\Framework\TestCase
1922
{
2023
/**
@@ -59,10 +62,24 @@ protected function setUp()
5962
$this->resourceConnectionMock->expects($this->any())->method('getConnection')->willReturn($this->adapterMock);
6063
$this->metadataPoolMock = $this->createMock(MetadataPool::class);
6164

65+
$indexScopeResolverMock = $this->createMock(
66+
\Magento\Framework\Indexer\ScopeResolver\IndexScopeResolver::class
67+
);
68+
$traversableMock = $this->createMock(\Traversable::class);
69+
$dimensionsMock = $this->createMock(\Magento\Framework\Indexer\MultiDimensionProvider::class);
70+
$dimensionsMock->method('getIterator')->willReturn($traversableMock);
71+
$dimensionFactoryMock = $this->createMock(
72+
\Magento\Catalog\Model\Indexer\Product\Price\DimensionCollectionFactory::class
73+
);
74+
$dimensionFactoryMock->method('create')->willReturn($dimensionsMock);
75+
6276
$this->model = new Index(
6377
$this->resourceContextMock,
6478
$this->storeManagerMock,
65-
$this->metadataPoolMock
79+
$this->metadataPoolMock,
80+
'connectionName',
81+
$indexScopeResolverMock,
82+
$dimensionFactoryMock
6683
);
6784
}
6885

@@ -71,11 +88,13 @@ public function testGetPriceIndexDataUsesFrontendPriceIndexerTable()
7188
$storeId = 1;
7289
$storeMock = $this->createMock(StoreInterface::class);
7390
$storeMock->expects($this->any())->method('getId')->willReturn($storeId);
91+
$storeMock->method('getWebsiteId')->willReturn(1);
7492
$this->storeManagerMock->expects($this->once())->method('getStore')->with($storeId)->willReturn($storeMock);
7593

7694
$selectMock = $this->createMock(Select::class);
7795
$selectMock->expects($this->any())->method('from')->willReturnSelf();
7896
$selectMock->expects($this->any())->method('where')->willReturnSelf();
97+
$selectMock->expects($this->any())->method('union')->willReturnSelf();
7998
$this->adapterMock->expects($this->once())->method('select')->willReturn($selectMock);
8099
$this->adapterMock->expects($this->once())->method('fetchAll')->with($selectMock)->willReturn([]);
81100

app/code/Magento/AdvancedSearch/composer.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,8 @@
1717
},
1818
"type": "magento2-module",
1919
"license": [
20-
"proprietary"
20+
"OSL-3.0",
21+
"AFL-3.0"
2122
],
2223
"autoload": {
2324
"files": [
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
}

0 commit comments

Comments
 (0)