Skip to content

Commit d26363c

Browse files
committed
Merge remote-tracking branch 'origin/2.2-develop' into 2.2-develop-pr40
2 parents 75403ff + c8b7ea9 commit d26363c

File tree

7 files changed

+56
-50
lines changed

7 files changed

+56
-50
lines changed

app/code/Magento/Backend/Helper/Dashboard/Order.php

Lines changed: 13 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
* @api
1414
* @since 100.0.2
1515
*/
16-
class Order extends \Magento\Backend\Helper\Dashboard\AbstractDashboard
16+
class Order extends AbstractDashboard
1717
{
1818
/**
1919
* @var \Magento\Reports\Model\ResourceModel\Order\Collection
@@ -29,32 +29,25 @@ class Order extends \Magento\Backend\Helper\Dashboard\AbstractDashboard
2929
/**
3030
* @param \Magento\Framework\App\Helper\Context $context
3131
* @param \Magento\Reports\Model\ResourceModel\Order\Collection $orderCollection
32+
* @param \Magento\Store\Model\StoreManagerInterface $storeManager
3233
*/
3334
public function __construct(
3435
\Magento\Framework\App\Helper\Context $context,
35-
\Magento\Reports\Model\ResourceModel\Order\Collection $orderCollection
36+
\Magento\Reports\Model\ResourceModel\Order\Collection $orderCollection,
37+
\Magento\Store\Model\StoreManagerInterface $storeManager = null
3638
) {
3739
$this->_orderCollection = $orderCollection;
38-
parent::__construct($context);
39-
}
40+
$this->_storeManager = $storeManager ?: ObjectManager::getInstance()
41+
->get(\Magento\Store\Model\StoreManagerInterface::class);
4042

41-
/**
42-
* The getter function to get the new StoreManager dependency
43-
*
44-
* @return \Magento\Store\Model\StoreManagerInterface
45-
*
46-
* @deprecated 100.1.0
47-
*/
48-
private function getStoreManager()
49-
{
50-
if ($this->_storeManager === null) {
51-
$this->_storeManager = ObjectManager::getInstance()->get(\Magento\Store\Model\StoreManagerInterface::class);
52-
}
53-
return $this->_storeManager;
43+
parent::__construct($context);
5444
}
5545

5646
/**
5747
* @return void
48+
*
49+
* @throws \Magento\Framework\Exception\LocalizedException
50+
* @throws \Magento\Framework\Exception\NoSuchEntityException
5851
*/
5952
protected function _initCollection()
6053
{
@@ -65,15 +58,15 @@ protected function _initCollection()
6558
if ($this->getParam('store')) {
6659
$this->_collection->addFieldToFilter('store_id', $this->getParam('store'));
6760
} elseif ($this->getParam('website')) {
68-
$storeIds = $this->getStoreManager()->getWebsite($this->getParam('website'))->getStoreIds();
61+
$storeIds = $this->_storeManager->getWebsite($this->getParam('website'))->getStoreIds();
6962
$this->_collection->addFieldToFilter('store_id', ['in' => implode(',', $storeIds)]);
7063
} elseif ($this->getParam('group')) {
71-
$storeIds = $this->getStoreManager()->getGroup($this->getParam('group'))->getStoreIds();
64+
$storeIds = $this->_storeManager->getGroup($this->getParam('group'))->getStoreIds();
7265
$this->_collection->addFieldToFilter('store_id', ['in' => implode(',', $storeIds)]);
7366
} elseif (!$this->_collection->isLive()) {
7467
$this->_collection->addFieldToFilter(
7568
'store_id',
76-
['eq' => $this->getStoreManager()->getStore(\Magento\Store\Model\Store::ADMIN_CODE)->getId()]
69+
['eq' => $this->_storeManager->getStore(\Magento\Store\Model\Store::ADMIN_CODE)->getId()]
7770
);
7871
}
7972
$this->_collection->load();

app/code/Magento/Catalog/Pricing/Price/RegularPrice.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,14 +22,14 @@ class RegularPrice extends AbstractPrice implements BasePriceProviderInterface
2222
/**
2323
* Get price value
2424
*
25-
* @return float|bool
25+
* @return float
2626
*/
2727
public function getValue()
2828
{
2929
if ($this->value === null) {
3030
$price = $this->product->getPrice();
3131
$priceInCurrentCurrency = $this->priceCurrency->convertAndRound($price);
32-
$this->value = $priceInCurrentCurrency ? (float)$priceInCurrentCurrency : false;
32+
$this->value = $priceInCurrentCurrency ? (float)$priceInCurrentCurrency : 0;
3333
}
3434
return $this->value;
3535
}

app/code/Magento/Config/etc/system_file.xsd

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -474,7 +474,7 @@
474474
</xs:documentation>
475475
</xs:annotation>
476476
<xs:restriction base="xs:string">
477-
<xs:pattern value="[A-Za-z0-9\\:]+" />
477+
<xs:pattern value="[A-Za-z0-9_\\:]+" />
478478
<xs:minLength value="5" />
479479
</xs:restriction>
480480
</xs:simpleType>

app/code/Magento/Sales/Setup/UpgradeData.php

Lines changed: 25 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -173,31 +173,32 @@ private function convertSerializedDataToJson($setupVersion, SalesSetup $salesSet
173173

174174
/**
175175
* Fill quote_address_id in table sales_order_address if it is empty.
176+
*
177+
* @param ModuleDataSetupInterface $setup
176178
*/
177-
public function fillQuoteAddressIdInSalesOrderAddress()
179+
public function fillQuoteAddressIdInSalesOrderAddress(ModuleDataSetupInterface $setup)
178180
{
179-
$addressCollection = $this->addressCollectionFactory->create();
180-
$addressCollection->addFieldToFilter('quote_address_id', ['null' => true]);
181-
182-
/** @var \Magento\Sales\Model\Order\Address $orderAddress */
183-
foreach ($addressCollection as $orderAddress) {
184-
$orderId = $orderAddress->getParentId();
185-
$addressType = $orderAddress->getAddressType();
186-
187-
/** @var \Magento\Sales\Model\Order $order */
188-
$order = $this->orderFactory->create()->load($orderId);
189-
$quoteId = $order->getQuoteId();
190-
$quote = $this->quoteFactory->create()->load($quoteId);
191-
192-
if ($addressType == \Magento\Sales\Model\Order\Address::TYPE_SHIPPING) {
193-
$quoteAddressId = $quote->getShippingAddress()->getId();
194-
$orderAddress->setData('quote_address_id', $quoteAddressId);
195-
} elseif ($addressType == \Magento\Sales\Model\Order\Address::TYPE_BILLING) {
196-
$quoteAddressId = $quote->getBillingAddress()->getId();
197-
$orderAddress->setData('quote_address_id', $quoteAddressId);
198-
}
199-
200-
$orderAddress->save();
201-
}
181+
$addressTable = $setup->getTable('sales_order_address');
182+
$updateOrderAddress = $setup->getConnection()
183+
->select()
184+
->joinInner(
185+
['sales_order' => $setup->getTable('sales_order')],
186+
$addressTable . '.parent_id = sales_order.entity_id',
187+
['quote_address_id' => 'quote_address.address_id']
188+
)
189+
->joinInner(
190+
['quote_address' => $setup->getTable('quote_address')],
191+
'sales_order.quote_id = quote_address.quote_id
192+
AND ' . $addressTable . '.address_type = quote_address.address_type',
193+
[]
194+
)
195+
->where(
196+
$addressTable . '.quote_address_id IS NULL'
197+
);
198+
$updateOrderAddress = $setup->getConnection()->updateFromSelect(
199+
$updateOrderAddress,
200+
$addressTable
201+
);
202+
$setup->getConnection()->query($updateOrderAddress);
202203
}
203204
}

app/code/Magento/Ui/view/base/web/js/grid/columns/multiselect.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -229,6 +229,15 @@ define([
229229
return this;
230230
},
231231

232+
/**
233+
* Selects or deselects all records on the current page.
234+
*
235+
* @returns {Multiselect} Chainable.
236+
*/
237+
togglePage: function () {
238+
return this.isPageSelected() ? this.deselectPage() : this.selectPage();
239+
},
240+
232241
/**
233242
* Clears the array of not selected records.
234243
*

app/code/Magento/Ui/view/base/web/js/grid/massactions.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -175,11 +175,14 @@ define([
175175
* invoked if action is confirmed.
176176
*/
177177
_confirm: function (action, callback) {
178-
var confirmData = action.confirm;
178+
var confirmData = action.confirm,
179+
data = this.getSelections(),
180+
total = data.total ? data.total : 0,
181+
confirmMessage = confirmData.message + ' (' + total + ' record' + (total > 1 ? 's' : '') + ')';
179182

180183
confirm({
181184
title: confirmData.title,
182-
content: confirmData.message,
185+
content: confirmMessage,
183186
actions: {
184187
confirm: callback
185188
}

app/code/Magento/Ui/view/base/web/templates/grid/columns/multiselect.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
data-bind="
1212
checked: allSelected(),
1313
attr: {id: ++ko.uid},
14-
event: { change: toggleSelectAll },
14+
event: { change: togglePage },
1515
css: { '_indeterminate': indetermine },
1616
enable: totalRecords">
1717
<label attr="for: ko.uid"/>

0 commit comments

Comments
 (0)