Skip to content

Commit 3d3d6aa

Browse files
authored
Merge pull request #20 from magento-commerce/develop
Merge develop into 1.0
2 parents 23feb3c + ff89ad2 commit 3d3d6aa

15 files changed

+142
-13
lines changed

.travis.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@ before_install:
7474
- if [ -n "${COMPOSER_VERSION}" ]; then travis_retry composer self-update ${COMPOSER_VERSION}; fi;
7575

7676
install:
77+
- phpenv config-add travis.php.ini
7778
- composer config http-basic.repo.magento.com ${REPO_USERNAME_CE} ${REPO_PASSWORD_CE}
7879
- composer config github-oauth.github.com ${GITHUB_TOKEN}
7980
- if [ -n "${MCD_VERSION}" ] && [ $TRAVIS_PHP_VERSION != "7.0" ]; then composer config repositories.mcd git [email protected]:magento/magento-cloud-docker.git && composer require "magento/magento-cloud-docker:${MCD_VERSION}" --no-update; fi;

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "magento/magento-cloud-patches",
33
"description": "Provides critical fixes for Magento 2 Enterprise Edition",
44
"type": "magento2-component",
5-
"version": "1.0.8",
5+
"version": "1.0.9",
66
"license": "OSL-3.0",
77
"require": {
88
"php": "^7.0",

patches.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -340,6 +340,11 @@
340340
"4.1.0": "BUNDLE-2683__braintree_settlement_report_fix__4.1.0.patch"
341341
}
342342
},
343+
"magento/magento2-b2b-base": {
344+
"Layered navigation filter is present only when product is present on the listing page with enabled Shared catalog": {
345+
">=1.1.5 <1.3.1": "MCLOUD-6923__layered_navigation_filter_is_present_only_when_product_is_present_on_the_listing_page_with_enabled_shared_catalog__2.3.5.patch"
346+
}
347+
},
343348
"magento/magento2-ee-base": {
344349
"Fix pagebuilder module": {
345350
"2.3.1": "PB-319__fix_pagebuilder_module__2.3.1.patch",
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
diff -Nuar a/vendor/magento/module-shared-catalog/Model/SearchAdapter/Aggregation/Builder/DataProvider.php b/vendor/magento/module-shared-catalog/Model/SearchAdapter/Aggregation/Builder/DataProvider.php
2+
--- a/vendor/magento/module-shared-catalog/Model/SearchAdapter/Aggregation/Builder/DataProvider.php
3+
+++ b/vendor/magento/module-shared-catalog/Model/SearchAdapter/Aggregation/Builder/DataProvider.php
4+
@@ -103,18 +103,16 @@ public function __construct(
5+
*
6+
* @param BucketInterface $bucket
7+
* @param array $dimensions
8+
- * @param array $documentIds
9+
* @return array
10+
* @throws \Magento\Framework\Exception\LocalizedException
11+
* @throws \Zend_Db_Statement_Exception
12+
*/
13+
public function getAggregation(
14+
BucketInterface $bucket,
15+
- array $dimensions,
16+
- array $documentIds
17+
+ array $dimensions
18+
) {
19+
$result = [];
20+
- $select = $this->getSelect($bucket, $dimensions, $documentIds);
21+
+ $select = $this->getSelect($bucket, $dimensions);
22+
$query = $this->connection->query($select);
23+
24+
while ($row = $query->fetch()) {
25+
@@ -134,11 +132,10 @@ public function getAggregation(
26+
*
27+
* @param BucketInterface $bucket
28+
* @param array $dimensions
29+
- * @param array $documentIds
30+
* @return Select
31+
* @throws \Magento\Framework\Exception\LocalizedException
32+
*/
33+
- private function getSelect(BucketInterface $bucket, array $dimensions, array $documentIds)
34+
+ private function getSelect(BucketInterface $bucket, array $dimensions)
35+
{
36+
$attribute = $this->eavConfig->getAttribute(Product::ENTITY, $bucket->getField());
37+
$currentScope = $this->scopeResolver->getScope($dimensions['scope']->getValue());
38+
@@ -161,7 +158,6 @@ private function getSelect(BucketInterface $bucket, array $dimensions, array $do
39+
'source_entity.sku = shared_catalog_item.sku',
40+
[]
41+
)
42+
- ->where('eav.entity_id IN (?)', $documentIds)
43+
->where('eav.attribute_id = ?', $attribute->getId())
44+
->where('eav.store_id = ? ', $currentScope->getId())
45+
->where('source_entity.type_id <> ?', 'configurable')
46+
diff -Nuar a/vendor/magento/module-shared-catalog/Plugin/Elasticsearch/SearchAdapter/Aggregation/Builder/UpdateTermBucketBuilderPlugin.php b/vendor/magento/module-shared-catalog/Plugin/Elasticsearch/SearchAdapter/Aggregation/Builder/UpdateTermBucketBuilderPlugin.php
47+
--- a/vendor/magento/module-shared-catalog/Plugin/Elasticsearch/SearchAdapter/Aggregation/Builder/UpdateTermBucketBuilderPlugin.php
48+
+++ b/vendor/magento/module-shared-catalog/Plugin/Elasticsearch/SearchAdapter/Aggregation/Builder/UpdateTermBucketBuilderPlugin.php
49+
@@ -65,8 +65,7 @@ public function afterBuild(
50+
$shouldAggregate = ($bucket->getField() !== 'category_ids');
51+
52+
if ($sharedCatalogIsEnabled && $shouldAggregate) {
53+
- $documentIds = array_column($queryResult['hits']['hits'], '_id');
54+
- $values = $this->dataProvider->getAggregation($bucket, $dimensions, $documentIds);
55+
+ $values = $this->dataProvider->getAggregation($bucket, $dimensions);
56+
}
57+
58+
return $values;

src/Command/Apply.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,12 +83,13 @@ protected function configure()
8383
*/
8484
public function execute(InputInterface $input, OutputInterface $output)
8585
{
86-
$this->logger->notice($this->magentoVersion->get());
86+
$this->logger->info($this->magentoVersion->get());
8787

8888
try {
8989
$this->applyOptional->run($input, $output);
9090
} catch (RuntimeException $e) {
9191
$output->writeln('<error>' . $e->getMessage() . '</error>');
92+
$this->logger->info($this->magentoVersion->get());
9293
$this->logger->error($e->getMessage());
9394

9495
return self::RETURN_FAILURE;

src/Command/Ece/Apply.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,14 +91,15 @@ protected function configure()
9191
*/
9292
public function execute(InputInterface $input, OutputInterface $output)
9393
{
94-
$this->logger->notice($this->magentoVersion->get());
94+
$this->logger->info($this->magentoVersion->get());
9595

9696
try {
9797
$this->applyRequired->run($input, $output);
9898
$this->applyOptional->run($input, $output);
9999
$this->applyLocal->run($input, $output);
100100
} catch (RuntimeException $e) {
101101
$output->writeln('<error>' . $e->getMessage() . '</error>');
102+
$this->logger->info($this->magentoVersion->get());
102103
$this->logger->error($e->getMessage());
103104

104105
return self::RETURN_FAILURE;

src/Command/Ece/Revert.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,12 +73,13 @@ protected function configure()
7373
*/
7474
public function execute(InputInterface $input, OutputInterface $output)
7575
{
76-
$this->logger->notice($this->magentoVersion->get());
76+
$this->logger->info($this->magentoVersion->get());
7777

7878
try {
7979
$this->revert->run($input, $output);
8080
} catch (RuntimeException $e) {
8181
$output->writeln('<error>' . $e->getMessage() . '</error>');
82+
$this->logger->info($this->magentoVersion->get());
8283
$this->logger->error($e->getMessage());
8384

8485
return self::RETURN_FAILURE;

src/Command/Revert.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,12 +96,13 @@ protected function configure()
9696
*/
9797
public function execute(InputInterface $input, OutputInterface $output)
9898
{
99-
$this->logger->notice($this->magentoVersion->get());
99+
$this->logger->info($this->magentoVersion->get());
100100

101101
try {
102102
$this->revert->run($input, $output);
103103
} catch (RuntimeException $e) {
104104
$output->writeln('<error>' . $e->getMessage() . '</error>');
105+
$this->logger->info($this->magentoVersion->get());
105106
$this->logger->error($e->getMessage());
106107

107108
return self::RETURN_FAILURE;

src/Patch/Applier.php

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -175,6 +175,23 @@ private function prepareContent(string $content): string
175175
$content = $this->gitConverter->convert($content);
176176
}
177177

178+
$content = $this->replaceDiffGit($content);
179+
178180
return $content;
179181
}
182+
183+
/**
184+
* Replace `diff --git`
185+
*
186+
* In some environments 'git apply' command skips applying a patch
187+
* while execution inside the git working tree. To prevent this issue
188+
* we need to replace `diff --git` with `diff -Nuar` in the patch source.
189+
*
190+
* @param string $content
191+
* @return string
192+
*/
193+
private function replaceDiffGit(string $content): string
194+
{
195+
return preg_replace(['/^diff --git/', '/\ndiff --git/'], ['diff -Nuar', "\ndiff -Nuar"], $content);
196+
}
180197
}

src/Patch/Pool/OptionalPool.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -231,7 +231,7 @@ function (PatchInterface $patch) {
231231
$diff = array_diff($filter, $resultIds);
232232
if (count($diff) > 0) {
233233
throw new PatchNotFoundException(
234-
'Next patches weren\'t found: ' . implode($diff, ' ') . '. ' .
234+
'Next patches weren\'t found: ' . implode(' ', $diff) . '. ' .
235235
'Please, check with "status" command availability of these patches for the current Magento version.'
236236
);
237237
}

0 commit comments

Comments
 (0)