Skip to content

Commit 859299d

Browse files
committed
Merge branch '2.2-develop' of github.com:magento/magento2ce into MAGETWO-92887
2 parents 33054be + 0a52f88 commit 859299d

File tree

63 files changed

+1444
-342
lines changed

Some content is hidden

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

63 files changed

+1444
-342
lines changed

app/code/Magento/Backend/Controller/Adminhtml/System/Store/DeleteStorePost.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,6 @@ public function execute()
3737
try {
3838
$model->delete();
3939

40-
$this->_eventManager->dispatch('store_delete', ['store' => $model]);
41-
4240
$this->messageManager->addSuccess(__('You deleted the store view.'));
4341
return $redirectResult->setPath('adminhtml/*/');
4442
} catch (\Magento\Framework\Exception\LocalizedException $e) {

app/code/Magento/Backend/Controller/Adminhtml/System/Store/Save.php

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,6 @@ private function processWebsiteSave($postData)
4646
*/
4747
private function processStoreSave($postData)
4848
{
49-
$eventName = 'store_edit';
5049
/** @var \Magento\Store\Model\Store $storeModel */
5150
$storeModel = $this->_objectManager->create(\Magento\Store\Model\Store::class);
5251
$postData['store']['name'] = $this->filterManager->removeTags($postData['store']['name']);
@@ -56,7 +55,6 @@ private function processStoreSave($postData)
5655
$storeModel->setData($postData['store']);
5756
if ($postData['store']['store_id'] == '') {
5857
$storeModel->setId(null);
59-
$eventName = 'store_add';
6058
}
6159
$groupModel = $this->_objectManager->create(
6260
\Magento\Store\Model\Group::class
@@ -70,8 +68,6 @@ private function processStoreSave($postData)
7068
);
7169
}
7270
$storeModel->save();
73-
$this->_objectManager->get(\Magento\Store\Model\StoreManager::class)->reinitStores();
74-
$this->_eventManager->dispatch($eventName, ['store' => $storeModel]);
7571
$this->messageManager->addSuccess(__('You saved the store view.'));
7672

7773
return $postData;
@@ -102,7 +98,6 @@ private function processGroupSave($postData)
10298
);
10399
}
104100
$groupModel->save();
105-
$this->_eventManager->dispatch('store_group_save', ['group' => $groupModel]);
106101
$this->messageManager->addSuccess(__('You saved the store.'));
107102

108103
return $postData;

app/code/Magento/Catalog/Model/ResourceModel/Product/Collection.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1079,14 +1079,15 @@ public function getAllAttributeValues($attribute)
10791079
$select = clone $this->getSelect();
10801080
$attribute = $this->getEntity()->getAttribute($attribute);
10811081

1082-
$aiField = $this->getConnection()->getAutoIncrementField($this->getMainTable());
1082+
$fieldMainTable = $this->getConnection()->getAutoIncrementField($this->getMainTable());
1083+
$fieldJoinTable = $attribute->getEntity()->getLinkField();
10831084
$select->reset()
10841085
->from(
10851086
['cpe' => $this->getMainTable()],
10861087
['entity_id']
10871088
)->join(
10881089
['cpa' => $attribute->getBackend()->getTable()],
1089-
'cpe.' . $aiField . ' = cpa.' . $aiField,
1090+
'cpe.' . $fieldMainTable . ' = cpa.' . $fieldJoinTable,
10901091
['store_id', 'value']
10911092
)->where('attribute_id = ?', (int)$attribute->getId());
10921093

app/code/Magento/Catalog/view/frontend/web/js/product/storage/storage-service.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ define([
4747
* @param {*} data
4848
*/
4949
add: function (data) {
50-
if (!utils.compare(data, this.data()).equal) {
50+
if (!_.isEmpty(data) && !utils.compare(data, this.data()).equal) {
5151
this.data(_.extend(utils.copy(this.data()), data));
5252
}
5353
},

app/code/Magento/CatalogWidget/Model/Rule/Condition/Product.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ public function addToCollection($collection)
118118
{
119119
$attribute = $this->getAttributeObject();
120120

121-
if ($collection->isEnabledFlat()) {
121+
if ($attribute->getUsedInProductListing() && $collection->isEnabledFlat()) {
122122
$alias = array_keys($collection->getSelect()->getPart('from'))[0];
123123
$this->joinedAttributes[$attribute->getAttributeCode()] = $alias . '.' . $attribute->getAttributeCode();
124124
return $this;
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
<?php
2+
/**
3+
* Copyright © Magento, Inc. All rights reserved.
4+
* See COPYING.txt for license details.
5+
*/
6+
declare(strict_types=1);
7+
8+
namespace Magento\Cms\Ui\Component;
9+
10+
use Magento\Framework\Api\Filter;
11+
use Magento\Framework\Api\Search\SearchCriteriaBuilder;
12+
13+
/**
14+
* Provides extension point to add additional filters to search criteria.
15+
*/
16+
interface AddFilterInterface
17+
{
18+
/**
19+
* Adds custom filter to search criteria builder based on received filter.
20+
*
21+
* @param SearchCriteriaBuilder $searchCriteriaBuilder
22+
* @param Filter $filter
23+
* @return void
24+
*/
25+
public function addFilter(SearchCriteriaBuilder $searchCriteriaBuilder, Filter $filter);
26+
}

app/code/Magento/Cms/Ui/Component/DataProvider.php

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
*/
66
namespace Magento\Cms\Ui\Component;
77

8+
use Magento\Framework\Api\Filter;
89
use Magento\Framework\Api\FilterBuilder;
910
use Magento\Framework\Api\Search\SearchCriteriaBuilder;
1011
use Magento\Framework\App\ObjectManager;
@@ -19,6 +20,11 @@ class DataProvider extends \Magento\Framework\View\Element\UiComponent\DataProvi
1920
*/
2021
private $authorization;
2122

23+
/**
24+
* @var AddFilterInterface[]
25+
*/
26+
private $additionalFilterPool;
27+
2228
/**
2329
* @param string $name
2430
* @param string $primaryFieldName
@@ -29,6 +35,8 @@ class DataProvider extends \Magento\Framework\View\Element\UiComponent\DataProvi
2935
* @param FilterBuilder $filterBuilder
3036
* @param array $meta
3137
* @param array $data
38+
* @param array $additionalFilterPool
39+
* @SuppressWarnings(PHPMD.ExcessiveParameterList)
3240
*/
3341
public function __construct(
3442
$name,
@@ -39,7 +47,8 @@ public function __construct(
3947
RequestInterface $request,
4048
FilterBuilder $filterBuilder,
4149
array $meta = [],
42-
array $data = []
50+
array $data = [],
51+
array $additionalFilterPool = []
4352
) {
4453
parent::__construct(
4554
$name,
@@ -54,6 +63,7 @@ public function __construct(
5463
);
5564

5665
$this->meta = array_replace_recursive($meta, $this->prepareMetadata());
66+
$this->additionalFilterPool = $additionalFilterPool;
5767
}
5868

5969
/**
@@ -95,4 +105,16 @@ public function prepareMetadata()
95105

96106
return $metadata;
97107
}
108+
109+
/**
110+
* @inheritdoc
111+
*/
112+
public function addFilter(Filter $filter)
113+
{
114+
if (!empty($this->additionalFilterPool[$filter->getField()])) {
115+
$this->additionalFilterPool[$filter->getField()]->addFilter($this->searchCriteriaBuilder, $filter);
116+
} else {
117+
parent::addFilter($filter);
118+
}
119+
}
98120
}
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
<?php
2+
/**
3+
* Copyright © Magento, Inc. All rights reserved.
4+
* See COPYING.txt for license details.
5+
*/
6+
declare(strict_types=1);
7+
8+
namespace Magento\Cms\Ui\Component\Page;
9+
10+
use Magento\Cms\Ui\Component\AddFilterInterface;
11+
use Magento\Framework\Api\Filter;
12+
use Magento\Framework\Api\FilterBuilder;
13+
use Magento\Framework\Api\Search\SearchCriteriaBuilder;
14+
15+
/**
16+
* Adds fulltext filter for CMS Page title attribute.
17+
*/
18+
class FulltextFilter implements AddFilterInterface
19+
{
20+
/**
21+
* @var FilterBuilder
22+
*/
23+
private $filterBuilder;
24+
25+
/**
26+
* @param FilterBuilder $filterBuilder
27+
*/
28+
public function __construct(FilterBuilder $filterBuilder)
29+
{
30+
$this->filterBuilder = $filterBuilder;
31+
}
32+
33+
/**
34+
* @inheritdoc
35+
*/
36+
public function addFilter(SearchCriteriaBuilder $searchCriteriaBuilder, Filter $filter)
37+
{
38+
$titleFilter = $this->filterBuilder->setField('title')
39+
->setValue(sprintf('%%%s%%', $filter->getValue()))
40+
->setConditionType('like')
41+
->create();
42+
$searchCriteriaBuilder->addFilter($titleFilter);
43+
}
44+
}

app/code/Magento/Cms/etc/di.xml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -189,4 +189,12 @@
189189
<argument name="collectionProcessor" xsi:type="object">Magento\Cms\Model\Api\SearchCriteria\BlockCollectionProcessor</argument>
190190
</arguments>
191191
</type>
192+
193+
<type name="Magento\Cms\Ui\Component\DataProvider">
194+
<arguments>
195+
<argument name="additionalFilterPool" xsi:type="array">
196+
<item name="fulltext" xsi:type="object">Magento\Cms\Ui\Component\Page\FulltextFilter</item>
197+
</argument>
198+
</arguments>
199+
</type>
192200
</config>

app/code/Magento/Payment/view/frontend/templates/transparent/iframe.phtml

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,9 +65,10 @@ $params = $block->getParams();
6565
'jquery',
6666
'Magento_Checkout/js/model/quote',
6767
'Magento_Checkout/js/action/place-order',
68-
'Magento_Checkout/js/action/redirect-on-success'
68+
'Magento_Checkout/js/action/redirect-on-success',
69+
'Magento_Checkout/js/model/full-screen-loader'
6970
],
70-
function($, quote, placeOrderAction, redirectOnSuccessAction) {
71+
function($, quote, placeOrderAction, redirectOnSuccessAction, fullScreenLoader) {
7172
var parent = window.top;
7273

7374
$(parent).trigger('clearTimeout');
@@ -77,6 +78,12 @@ $params = $block->getParams();
7778
function () {
7879
redirectOnSuccessAction.execute();
7980
}
81+
).fail(
82+
function () {
83+
var parent = window.top;
84+
$(parent).trigger('clearTimeout');
85+
fullScreenLoader.stopLoader();
86+
}
8087
);
8188
}
8289
);

0 commit comments

Comments
 (0)