Skip to content

Commit 306a77b

Browse files
author
Oleksandr Iegorov
committed
Merge branch '2.2-develop' of github.com:magento/magento2ce into MAGETWO-86289
2 parents 96f20ef + 160dc85 commit 306a77b

File tree

4 files changed

+21
-5
lines changed

4 files changed

+21
-5
lines changed

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

0 commit comments

Comments
 (0)