Skip to content

Commit 58dd8e2

Browse files
🔃 [EngCom] Public Pull Requests - 2.3-develop
Accepted Public Pull Requests: - #14787: Update Readme file for magento2 repository (by @sidolov) - #14782: [Forwardport] #13765 Excess requests 'customer data' on checkout cart page were fixed (by @andrewbess) - #14779: [Forwardport] Refactor Code for Mass Order Unhold (by @rostyslav-hymon) Fixed GitHub Issues: - #13765: "cart" section data gets loaded 3 times on cart page (2.2.2) (reported by @erikhansen) has been fixed in #14782 by @andrewbess in 2.3-develop branch Related commits: 1. c442f76 2. 5befa84
2 parents 782bc0e + 0134ee6 commit 58dd8e2

File tree

6 files changed

+64
-27
lines changed

6 files changed

+64
-27
lines changed

README.md

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,12 @@
66
Welcome to Magento 2 installation! We're glad you chose to install Magento 2, a cutting-edge, feature-rich eCommerce solution that gets results.
77

88
## Magento system requirements
9-
[Magento system requirements](http://devdocs.magento.com/guides/v2.2/install-gde/system-requirements2.html)
9+
[Magento system requirements](http://devdocs.magento.com/guides/v2.3/install-gde/system-requirements2.html)
1010

1111
## Install Magento
1212
To install Magento, see either:
1313

14-
* [Magento DevBox](https://magento.com/tech-resources/download), the easiest way to get started with Magento.
15-
* [Installation guide](http://devdocs.magento.com/guides/v2.2/install-gde/bk-install-guide.html)
14+
* [Installation guide](http://devdocs.magento.com/guides/v2.3/install-gde/bk-install-guide.html)
1615

1716
<h2>Contributing to the Magento 2 code base</h2>
1817
Contributions can take the form of new components or features, changes to existing features, tests, documentation (such as developer guides, user guides, examples, or specifications), bug fixes, optimizations, or just good suggestions.
@@ -23,11 +22,24 @@ To learn about issues, click [here][2]. To open an issue, click [here][3].
2322

2423
To suggest documentation improvements, click [here][4].
2524

26-
[1]: <http://devdocs.magento.com/guides/v2.2/contributor-guide/contributing.html>
27-
[2]: <http://devdocs.magento.com/guides/v2.2/contributor-guide/contributing.html#report>
25+
[1]: <http://devdocs.magento.com/guides/v2.3/contributor-guide/contributing.html>
26+
[2]: <http://devdocs.magento.com/guides/v2.3/contributor-guide/contributing.html#report>
2827
[3]: <https://github.com/magento/magento2/issues>
2928
[4]: <http://devdocs.magento.com>
3029

30+
<h3>Community Maintainers</h3>
31+
The members of this team have been recognized for their outstanding commitment to maintaining and improving Magento. Magento has granted them permission to accept, merge, and reject pull requests, as well as review issues, and thanks these Community Maintainers for their valuable contributions.
32+
33+
<a href="https://magento.com/magento-contributors#maintainers">
34+
<img src="https://raw.githubusercontent.com/wiki/magento/magento2/images/maintainers.png"/>
35+
</a>
36+
37+
<h3>Top Contributors</h3>
38+
Magento team thanks for any contribution that can improve our code base, documentation or increase test coverage. We always recognize our most active members, your contributions are the foundation of the Magento open source platform.
39+
<a href="https://magento.com/magento-contributors">
40+
<img src="https://raw.githubusercontent.com/wiki/magento/magento2/images/contributors.png"/>
41+
</a>
42+
3143
<h3>Labels applied by the Magento team</h3>
3244

3345
| Label | Description |

app/code/Magento/Checkout/view/frontend/web/js/model/totals.js

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,17 +14,20 @@ define([
1414
'use strict';
1515

1616
var quoteItems = ko.observable(quote.totals().items),
17-
cartData = customerData.get('cart'),
18-
quoteSubtotal = parseFloat(quote.totals().subtotal),
19-
subtotalAmount = parseFloat(cartData().subtotalAmount);
17+
cartData = customerData.get('cart');
2018

2119
quote.totals.subscribe(function (newValue) {
2220
quoteItems(newValue.items);
2321
});
2422

25-
if (quoteSubtotal !== subtotalAmount) {
26-
customerData.reload(['cart'], false);
27-
}
23+
cartData.subscribe(function () {
24+
var quoteSubtotal = parseFloat(quote.totals().subtotal),
25+
subtotalAmount = parseFloat(cartData().subtotalAmount);
26+
27+
if (quoteSubtotal !== subtotalAmount) {
28+
customerData.reload(['cart'], false);
29+
}
30+
}, this);
2831

2932
return {
3033
totals: quote.totals,

app/code/Magento/Checkout/view/frontend/web/js/view/minicart.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -94,17 +94,17 @@ define([
9494
this.isLoading(addToCartCalls > 0);
9595
sidebarInitialized = false;
9696
this.update(updatedCart);
97+
98+
if (cartData()['website_id'] !== window.checkout.websiteId) {
99+
customerData.reload(['cart'], false);
100+
}
97101
initSidebar();
98102
}, this);
99103
$('[data-block="minicart"]').on('contentLoading', function () {
100104
addToCartCalls++;
101105
self.isLoading(true);
102106
});
103107

104-
if (cartData()['website_id'] !== window.checkout.websiteId) {
105-
customerData.reload(['cart'], false);
106-
}
107-
108108
return this._super();
109109
},
110110
isLoading: ko.observable(false),

app/code/Magento/Customer/view/frontend/web/js/customer-data.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -232,9 +232,11 @@ define([
232232
if (!_.isEmpty(privateContent)) {
233233
countryData = this.get('directory-data');
234234

235-
if (_.isEmpty(countryData())) {
236-
customerData.reload(['directory-data'], false);
237-
}
235+
countryData.subscribe(function () {
236+
if (_.isEmpty(countryData())) {
237+
customerData.reload(['directory-data'], false);
238+
}
239+
}, this);
238240
}
239241
},
240242

app/code/Magento/Sales/Controller/Adminhtml/Order/MassUnhold.php

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,23 +9,37 @@
99
use Magento\Backend\App\Action\Context;
1010
use Magento\Ui\Component\MassAction\Filter;
1111
use Magento\Sales\Model\ResourceModel\Order\CollectionFactory;
12+
use Magento\Sales\Api\OrderManagementInterface;
1213

1314
class MassUnhold extends AbstractMassAction
1415
{
1516
/**
1617
* Authorization level of a basic admin session
1718
*/
1819
const ADMIN_RESOURCE = 'Magento_Sales::unhold';
20+
21+
/**
22+
* @var OrderManagementInterface
23+
*/
24+
private $orderManagement;
1925

2026
/**
2127
* @param Context $context
2228
* @param Filter $filter
2329
* @param CollectionFactory $collectionFactory
30+
* @param OrderManagementInterface|null $orderManagement
2431
*/
25-
public function __construct(Context $context, Filter $filter, CollectionFactory $collectionFactory)
26-
{
32+
public function __construct(
33+
Context $context,
34+
Filter $filter,
35+
CollectionFactory $collectionFactory,
36+
OrderManagementInterface $orderManagement = null
37+
) {
2738
parent::__construct($context, $filter);
2839
$this->collectionFactory = $collectionFactory;
40+
$this->orderManagement = $orderManagement ?: \Magento\Framework\App\ObjectManager::getInstance()->get(
41+
\Magento\Sales\Api\OrderManagementInterface::class
42+
);
2943
}
3044

3145
/**
@@ -40,12 +54,10 @@ protected function massAction(AbstractCollection $collection)
4054

4155
/** @var \Magento\Sales\Model\Order $order */
4256
foreach ($collection->getItems() as $order) {
43-
$order->load($order->getId());
4457
if (!$order->canUnhold()) {
4558
continue;
4659
}
47-
$order->unhold();
48-
$order->save();
60+
$this->orderManagement->unHold($order->getEntityId());
4961
$countUnHoldOrder++;
5062
}
5163

app/code/Magento/Sales/Test/Unit/Controller/Adminhtml/Order/MassUnholdTest.php

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,11 @@ class MassUnholdTest extends \PHPUnit\Framework\TestCase
8585
*/
8686
protected $filterMock;
8787

88+
/**
89+
* @var \PHPUnit_Framework_MockObject_MockObject
90+
*/
91+
private $orderManagementMock;
92+
8893
protected function setUp()
8994
{
9095
$objectManagerHelper = new ObjectManagerHelper($this);
@@ -146,12 +151,15 @@ protected function setUp()
146151
->method('create')
147152
->willReturn($this->orderCollectionMock);
148153

154+
$this->orderManagementMock = $this->createMock(\Magento\Sales\Api\OrderManagementInterface::class);
155+
149156
$this->massAction = $objectManagerHelper->getObject(
150157
\Magento\Sales\Controller\Adminhtml\Order\MassUnhold::class,
151158
[
152159
'context' => $this->contextMock,
153160
'filter' => $this->filterMock,
154-
'collectionFactory' => $this->orderCollectionFactoryMock
161+
'collectionFactory' => $this->orderCollectionFactoryMock,
162+
'orderManagement' => $this->orderManagementMock
155163
]
156164
);
157165
}
@@ -175,9 +183,7 @@ public function testExecuteOneOrdersReleasedFromHold()
175183
->method('canUnhold')
176184
->willReturn(true);
177185
$order1->expects($this->once())
178-
->method('unhold');
179-
$order1->expects($this->once())
180-
->method('save');
186+
->method('getEntityId');
181187

182188
$this->orderCollectionMock->expects($this->once())
183189
->method('count')
@@ -187,6 +193,8 @@ public function testExecuteOneOrdersReleasedFromHold()
187193
->method('canUnhold')
188194
->willReturn(false);
189195

196+
$this->orderManagementMock->expects($this->atLeastOnce())->method('unHold')->willReturn(true);
197+
190198
$this->messageManagerMock->expects($this->once())
191199
->method('addError')
192200
->with('1 order(s) were not released from on hold status.');

0 commit comments

Comments
 (0)