Skip to content

Commit 9dde1a0

Browse files
committed
Merge remote-tracking branch 'mainline/2.2-develop' into DEVOPS-2174-2.2
2 parents fbefb5d + 9cfd602 commit 9dde1a0

File tree

101 files changed

+1950
-157
lines changed

Some content is hidden

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

101 files changed

+1950
-157
lines changed

app/code/Magento/Backend/Block/GlobalSearch.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@ public function getWidgetInitOptions()
7373
'filterProperty' => 'name',
7474
'preventClickPropagation' => false,
7575
'minLength' => 2,
76+
'submitInputOnEnter' => false,
7677
]
7778
];
7879
}

app/code/Magento/Catalog/Block/Product/ListProduct.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -356,7 +356,7 @@ public function getIdentities()
356356
* Get post parameters
357357
*
358358
* @param Product $product
359-
* @return string
359+
* @return array
360360
*/
361361
public function getAddToCartPostParams(Product $product)
362362
{

app/code/Magento/Catalog/Model/Product/Attribute/SetRepository.php

Lines changed: 26 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,6 @@
66
*/
77
namespace Magento\Catalog\Model\Product\Attribute;
88

9-
use Magento\Framework\Exception\InputException;
10-
119
class SetRepository implements \Magento\Catalog\Api\AttributeSetRepositoryInterface
1210
{
1311
/**
@@ -53,7 +51,7 @@ public function __construct(
5351
*/
5452
public function save(\Magento\Eav\Api\Data\AttributeSetInterface $attributeSet)
5553
{
56-
$this->validate($attributeSet);
54+
$this->validateBeforeSave($attributeSet);
5755
return $this->attributeSetRepository->save($attributeSet);
5856
}
5957

@@ -127,4 +125,29 @@ protected function validate(\Magento\Eav\Api\Data\AttributeSetInterface $attribu
127125
);
128126
}
129127
}
128+
129+
/**
130+
* Validate attribute set entity type id.
131+
*
132+
* @param \Magento\Eav\Api\Data\AttributeSetInterface $attributeSet
133+
* @return void
134+
* @throws \Magento\Framework\Exception\StateException
135+
* @throws \Magento\Framework\Exception\NoSuchEntityException
136+
* @throws \Magento\Framework\Exception\LocalizedException
137+
*/
138+
private function validateBeforeSave(\Magento\Eav\Api\Data\AttributeSetInterface $attributeSet)
139+
{
140+
$productEntityId = $this->eavConfig->getEntityType(\Magento\Catalog\Model\Product::ENTITY)->getId();
141+
$result = $attributeSet->getEntityTypeId() === $productEntityId;
142+
if (!$result && $attributeSet->getAttributeSetId()) {
143+
$existingAttributeSet = $this->attributeSetRepository->get($attributeSet->getAttributeSetId());
144+
$attributeSet->setEntityTypeId($existingAttributeSet->getEntityTypeId());
145+
$result = $existingAttributeSet->getEntityTypeId() === $productEntityId;
146+
}
147+
if (!$result) {
148+
throw new \Magento\Framework\Exception\StateException(
149+
__('Provided Attribute set non product Attribute set.')
150+
);
151+
}
152+
}
130153
}

app/code/Magento/CatalogInventory/i18n/en_US.csv

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -55,11 +55,7 @@ Inventory,Inventory
5555
"Only X left Threshold","Only X left Threshold"
5656
"Display Products Availability in Stock on Storefront","Display Products Availability in Stock on Storefront"
5757
"Product Stock Options","Product Stock Options"
58-
"
59-
Please note that these settings apply to individual items in the cart, not to the entire cart.
60-
","
61-
Please note that these settings apply to individual items in the cart, not to the entire cart.
62-
"
58+
"Please note that these settings apply to individual items in the cart, not to the entire cart.","Please note that these settings apply to individual items in the cart, not to the entire cart."
6359
"Manage Stock","Manage Stock"
6460
Backorders,Backorders
6561
"Maximum Qty Allowed in Shopping Cart","Maximum Qty Allowed in Shopping Cart"

app/code/Magento/CatalogRule/Block/Adminhtml/Promo/Widget/Chooser/Sku.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,7 @@ protected function _prepareColumns()
207207
public function getGridUrl()
208208
{
209209
return $this->getUrl(
210-
'catalog_rule/*/chooser',
210+
'*/*/chooser',
211211
['_current' => true, 'current_grid_id' => $this->getId(), 'collapse' => null]
212212
);
213213
}
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
<?php
2+
/**
3+
* Copyright © Magento, Inc. All rights reserved.
4+
* See COPYING.txt for license details.
5+
*/
6+
7+
namespace Magento\CatalogSearch\Ui\DataProvider\Product;
8+
9+
use Magento\Framework\Data\Collection;
10+
use Magento\CatalogSearch\Model\ResourceModel\Search\Collection as SearchCollection;
11+
use Magento\Ui\DataProvider\AddFilterToCollectionInterface;
12+
13+
/**
14+
* Adds FullText search to Product Data Provider
15+
*/
16+
class AddFulltextFilterToCollection implements AddFilterToCollectionInterface
17+
{
18+
/**
19+
* Search Collection
20+
*
21+
* @var SearchCollection
22+
*/
23+
private $searchCollection;
24+
25+
/**
26+
* @param SearchCollection $searchCollection
27+
*/
28+
public function __construct(SearchCollection $searchCollection)
29+
{
30+
$this->searchCollection = $searchCollection;
31+
}
32+
33+
/**
34+
* {@inheritdoc}
35+
*
36+
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
37+
*/
38+
public function addFilter(Collection $collection, $field, $condition = null)
39+
{
40+
/** @var $collection \Magento\Catalog\Model\ResourceModel\Product\Collection */
41+
if (isset($condition['fulltext']) && !empty($condition['fulltext'])) {
42+
$this->searchCollection->addBackendSearchFilter($condition['fulltext']);
43+
$productIds = $this->searchCollection->load()->getAllIds();
44+
$collection->addIdFilter($productIds);
45+
}
46+
}
47+
}

app/code/Magento/CatalogSearch/composer.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
"magento/module-eav": "101.0.*",
1313
"magento/module-backend": "100.2.*",
1414
"magento/module-theme": "100.2.*",
15+
"magento/module-ui": "101.0.*",
1516
"magento/module-catalog-inventory": "100.2.*",
1617
"magento/framework": "101.0.*"
1718
},

app/code/Magento/CatalogSearch/etc/adminhtml/di.xml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,4 +19,11 @@
1919
<type name="Magento\Catalog\Block\Adminhtml\Product\Attribute\Edit\Tab\Front">
2020
<plugin name="search_weigh" type="Magento\CatalogSearch\Block\Plugin\FrontTabPlugin" />
2121
</type>
22+
<type name="Magento\Catalog\Ui\DataProvider\Product\ProductDataProvider">
23+
<arguments>
24+
<argument name="addFilterStrategies" xsi:type="array">
25+
<item name="fulltext" xsi:type="object">Magento\CatalogSearch\Ui\DataProvider\Product\AddFulltextFilterToCollection</item>
26+
</argument>
27+
</arguments>
28+
</type>
2229
</config>
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
/**
4+
* Copyright © Magento, Inc. All rights reserved.
5+
* See COPYING.txt for license details.
6+
*/
7+
-->
8+
<listing xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Ui:etc/ui_configuration.xsd">
9+
<listingToolbar name="listing_top">
10+
<filterSearch name="fulltext"/>
11+
</listingToolbar>
12+
</listing>

app/code/Magento/Cms/Model/ResourceModel/Block/Grid/Collection.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
namespace Magento\Cms\Model\ResourceModel\Block\Grid;
77

88
use Magento\Framework\Api\Search\SearchResultInterface;
9-
use Magento\Framework\Search\AggregationInterface;
9+
use Magento\Framework\Api\Search\AggregationInterface;
1010
use Magento\Cms\Model\ResourceModel\Block\Collection as BlockCollection;
1111

1212
/**
@@ -82,6 +82,7 @@ public function getAggregations()
8282
public function setAggregations($aggregations)
8383
{
8484
$this->aggregations = $aggregations;
85+
return $this;
8586
}
8687

8788
/**

0 commit comments

Comments
 (0)