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

Commit ce50f48

Browse files
committed
Merge branch '2.3-develop' into complexity-limiter
2 parents 335c173 + b647e9e commit ce50f48

File tree

3,018 files changed

+92076
-42549
lines changed

Some content is hidden

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

3,018 files changed

+92076
-42549
lines changed

.github/ISSUE_TEMPLATE/bug_report.md

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
---
2+
name: Bug report
3+
about: Technical issue with the Magento 2 core components
4+
5+
---
6+
7+
<!---
8+
Please review our guidelines before adding a new issue: https://github.com/magento/magento2/wiki/Issue-reporting-guidelines
9+
-->
10+
11+
### Preconditions
12+
<!---
13+
Provide the exact Magento version (example: 2.2.5) and any important information on the environment where bug is reproducible.
14+
-->
15+
1.
16+
2.
17+
18+
### Steps to reproduce
19+
<!---
20+
Important: Provide a set of clear steps to reproduce this bug. We can not provide support without clear instructions on how to reproduce.
21+
-->
22+
1.
23+
2.
24+
25+
### Expected result
26+
<!--- Tell us what do you expect to happen. -->
27+
1. [Screenshots, logs or description]
28+
2.
29+
30+
### Actual result
31+
<!--- Tell us what happened instead. Include error messages and issues. -->
32+
1. [Screenshots, logs or description]
33+
2.
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
---
2+
name: Developer experience issue
3+
about: Issues related to customization, extensibility, modularity
4+
5+
---
6+
7+
<!---
8+
Please review our guidelines before adding a new issue: https://github.com/magento/magento2/wiki/Issue-reporting-guidelines
9+
-->
10+
11+
### Summary
12+
<!--- Describe the issue you are experiencing. Include general information, error messages, environments, and so on. -->
13+
14+
### Examples
15+
<!--- Provide code examples or a patch with a test (recommended) to clearly indicate the problem. -->
16+
17+
### Proposed solution
18+
<!--- Suggest your potential solutions for this issue. -->
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
---
2+
name: Feature request
3+
about: Please consider reporting directly to https://github.com/magento/community-features
4+
5+
---
6+
7+
<!---
8+
Important: This repository is intended only for Magento 2 Technical Issues. Enter Feature Requests at https://github.com/magento/community-features. Project stakeholders monitor and manage requests. Feature requests entered using this form may be moved to the forum.
9+
-->
10+
11+
### Description
12+
<!--- Describe the feature you would like to add. -->
13+
14+
### Expected behavior
15+
<!--- What is the expected behavior of this feature? How is it going to work? -->
16+
17+
### Benefits
18+
<!--- How do you think this feature would improve Magento? -->
19+
20+
### Additional information
21+
<!--- What other information can you provide about the desired feature? -->

app/bootstrap.php

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,6 @@
3131
// Sets default autoload mappings, may be overridden in Bootstrap::create
3232
\Magento\Framework\App\Bootstrap::populateAutoloader(BP, []);
3333

34-
require_once BP . '/app/functions.php';
35-
3634
/* Custom umask value may be provided in optional mage_umask file in root */
3735
$umaskFile = BP . '/magento_umask';
3836
$mask = file_exists($umaskFile) ? octdec(file_get_contents($umaskFile)) : 002;
@@ -54,8 +52,16 @@
5452
&& isset($_SERVER['HTTP_ACCEPT'])
5553
&& strpos($_SERVER['HTTP_ACCEPT'], 'text/html') !== false
5654
) {
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')),
55+
$profilerConfig = isset($_SERVER['MAGE_PROFILER']) && strlen($_SERVER['MAGE_PROFILER'])
56+
? $_SERVER['MAGE_PROFILER']
57+
: trim(file_get_contents(BP . '/var/profiler.flag'));
58+
59+
if ($profilerConfig) {
60+
$profilerConfig = json_decode($profilerConfig, true) ?: $profilerConfig;
61+
}
62+
63+
Magento\Framework\Profiler::applyConfig(
64+
$profilerConfig,
5965
BP,
6066
!empty($_SERVER['HTTP_X_REQUESTED_WITH']) && $_SERVER['HTTP_X_REQUESTED_WITH'] == 'XMLHttpRequest'
6167
);

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/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/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.

0 commit comments

Comments
 (0)