Skip to content

Commit 8b32f5e

Browse files
author
Oleksandr Iegorov
committed
Merge branch '2.2-develop' of github.com:magento/magento2ce into MAGETWO-88504
2 parents 24bd382 + b330f86 commit 8b32f5e

File tree

8 files changed

+48
-23
lines changed

8 files changed

+48
-23
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/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
}

app/code/Magento/CatalogSearch/Ui/DataProvider/Product/AddFulltextFilterToCollection.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
use Magento\Ui\DataProvider\AddFilterToCollectionInterface;
1212

1313
/**
14-
* Class AddFulltextFilterToCollection
14+
* Adds FullText search to Product Data Provider
1515
*/
1616
class AddFulltextFilterToCollection implements AddFilterToCollectionInterface
1717
{

app/code/Magento/Paypal/Model/Express/Checkout.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -809,7 +809,9 @@ public function place($token, $shippingMethodCode = null)
809809
case \Magento\Sales\Model\Order::STATE_PROCESSING:
810810
case \Magento\Sales\Model\Order::STATE_COMPLETE:
811811
case \Magento\Sales\Model\Order::STATE_PAYMENT_REVIEW:
812-
$this->orderSender->send($order);
812+
if (!$order->getEmailSent()) {
813+
$this->orderSender->send($order);
814+
}
813815
$this->_checkoutSession->start();
814816
break;
815817
default:

app/code/Magento/Quote/Model/ResourceModel/Quote/Item/Collection.php

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,11 @@ class Collection extends \Magento\Framework\Model\ResourceModel\Db\VersionContro
4545
*/
4646
protected $_quoteConfig;
4747

48+
/**
49+
* @var \Magento\Store\Model\StoreManagerInterface|null
50+
*/
51+
private $storeManager;
52+
4853
/**
4954
* @param \Magento\Framework\Data\Collection\EntityFactory $entityFactory
5055
* @param \Psr\Log\LoggerInterface $logger
@@ -56,6 +61,7 @@ class Collection extends \Magento\Framework\Model\ResourceModel\Db\VersionContro
5661
* @param \Magento\Quote\Model\Quote\Config $quoteConfig
5762
* @param \Magento\Framework\DB\Adapter\AdapterInterface $connection
5863
* @param \Magento\Framework\Model\ResourceModel\Db\AbstractDb $resource
64+
* @param \Magento\Store\Model\StoreManagerInterface|null $storeManager
5965
* @SuppressWarnings(PHPMD.ExcessiveParameterList)
6066
*/
6167
public function __construct(
@@ -68,7 +74,8 @@ public function __construct(
6874
\Magento\Catalog\Model\ResourceModel\Product\CollectionFactory $productCollectionFactory,
6975
\Magento\Quote\Model\Quote\Config $quoteConfig,
7076
\Magento\Framework\DB\Adapter\AdapterInterface $connection = null,
71-
\Magento\Framework\Model\ResourceModel\Db\AbstractDb $resource = null
77+
\Magento\Framework\Model\ResourceModel\Db\AbstractDb $resource = null,
78+
\Magento\Store\Model\StoreManagerInterface $storeManager = null
7279
) {
7380
parent::__construct(
7481
$entityFactory,
@@ -82,6 +89,10 @@ public function __construct(
8289
$this->_itemOptionCollectionFactory = $itemOptionCollectionFactory;
8390
$this->_productCollectionFactory = $productCollectionFactory;
8491
$this->_quoteConfig = $quoteConfig;
92+
93+
// Backward compatibility constructor parameters
94+
$this->storeManager = $storeManager ?:
95+
\Magento\Framework\App\ObjectManager::getInstance()->get(\Magento\Store\Model\StoreManagerInterface::class);
8596
}
8697

8798
/**
@@ -101,7 +112,10 @@ protected function _construct()
101112
*/
102113
public function getStoreId()
103114
{
104-
return (int)$this->_productCollectionFactory->create()->getStoreId();
115+
// Fallback to current storeId if no quote is provided
116+
// (see https://github.com/magento/magento2/commit/9d3be732a88884a66d667b443b3dc1655ddd0721)
117+
return $this->_quote === null ?
118+
(int) $this->storeManager->getStore()->getId() : (int) $this->_quote->getStoreId();
105119
}
106120

107121
/**

app/code/Magento/Review/view/frontend/templates/view.phtml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@
4949
<div class="actions">
5050
<div class="secondary">
5151
<a class="action back" href="<?= $block->escapeUrl($block->getBackUrl()) ?>">
52-
<span><?= $block->escapeHtml(__('Back to Product Reviews')) ?></a></span>
52+
<span><?= $block->escapeHtml(__('Back to Product Reviews')) ?></span>
5353
</a>
5454
</div>
5555
</div>

app/code/Magento/Search/Model/SynonymAnalyzer.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ public function getSynonymsForPhrase($phrase)
8282
/**
8383
* Helper method to find the matching of $pattern to $synonymGroupsToExamine.
8484
* If matches, the particular array index is returned.
85-
* Otherwise false will be returned.
85+
* Otherwise null will be returned.
8686
*
8787
* @param string $pattern
8888
* @param array $synonymGroupsToExamine

lib/web/mage/backend/suggest.js

Lines changed: 24 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,8 @@
6565
inputWrapper: '<div class="mage-suggest"><div class="mage-suggest-inner"></div></div>',
6666
dropdownWrapper: '<div class="mage-suggest-dropdown"></div>',
6767
preventClickPropagation: true,
68-
currentlySelected: null
68+
currentlySelected: null,
69+
submitInputOnEnter: true
6970
},
7071

7172
/**
@@ -79,7 +80,6 @@
7980
label: ''
8081
};
8182
this.templates = {};
82-
8383
this._renderedContext = null;
8484
this._selectedItem = this._nonSelectedItem;
8585
this._control = this.options.controls || {};
@@ -312,18 +312,23 @@
312312
click: this.search
313313
}, this.options.events));
314314

315+
this._bindSubmit();
315316
this._bindDropdown();
316317
},
317318

318319
/**
319-
* @param {Object} event - event object
320+
* @param {Object} event
320321
* @private
321322
*/
322323
_toggleEnter: function (event) {
323324
var suggestList,
324325
activeItems,
325326
selectedItem;
326327

328+
if (!this.options.submitInputOnEnter) {
329+
event.preventDefault();
330+
}
331+
327332
suggestList = $(event.currentTarget.parentNode).find('ul').first();
328333
activeItems = suggestList.find('._active');
329334

@@ -333,12 +338,22 @@
333338
if (selectedItem.find('a') && selectedItem.find('a').attr('href') !== undefined) {
334339
window.location = selectedItem.find('a').attr('href');
335340
event.preventDefault();
336-
337-
return false;
338341
}
339342
}
340343
},
341344

345+
/**
346+
* Bind handlers for submit on enter
347+
* @private
348+
*/
349+
_bindSubmit: function () {
350+
this.element.parents('form').on('submit', function (event) {
351+
if (!this.submitInputOnEnter) {
352+
event.preventDefault();
353+
}
354+
});
355+
},
356+
342357
/**
343358
* @param {Object} e - event object
344359
* @private
@@ -465,8 +480,8 @@
465480
}
466481

467482
if (this._trigger('beforeselect', e || null, {
468-
item: this._focused
469-
}) === false) {
483+
item: this._focused
484+
}) === false) {
470485
return;
471486
}
472487
this._selectItem(e);
@@ -701,9 +716,6 @@
701716
if ($.isArray(o.source)) {
702717
response(this.filter(o.source, term));
703718
} else if ($.type(o.source) === 'string') {
704-
if (this._xhr) {
705-
this._xhr.abort();
706-
}
707719
ajaxData = {};
708720
ajaxData[this.options.termAjaxArgument] = term;
709721

@@ -729,10 +741,6 @@
729741
_abortSearch: function () {
730742
this.element.removeClass(this.options.loadingClass);
731743
clearTimeout(this._searchTimeout);
732-
733-
if (this._xhr) {
734-
this._xhr.abort();
735-
}
736744
},
737745

738746
/**
@@ -905,8 +913,8 @@
905913
'<li class="mage-suggest-search-field" data-role="parent-choice-element"><' +
906914
'label class="mage-suggest-search-label"></label></li></ul>',
907915
choiceTemplate: '<li class="mage-suggest-choice button"><div><%- text %></div>' +
908-
'<span class="mage-suggest-choice-close" tabindex="-1" ' +
909-
'data-mage-init=\'{"actionLink":{"event":"removeOption"}}\'></span></li>',
916+
'<span class="mage-suggest-choice-close" tabindex="-1" ' +
917+
'data-mage-init=\'{"actionLink":{"event":"removeOption"}}\'></span></li>',
910918
selectedClass: 'mage-suggest-selected'
911919
},
912920

0 commit comments

Comments
 (0)