Skip to content

Commit 7494455

Browse files
author
Yevhen Miroshnychenko
committed
Merge branch '2.2-develop' into MAGETWO-92154
2 parents 4587b30 + 323994f commit 7494455

File tree

12 files changed

+242
-225
lines changed

12 files changed

+242
-225
lines changed

app/code/Magento/Customer/view/frontend/templates/logout.phtml

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,12 @@
77
/** @var \Magento\Framework\View\Element\Template $block */
88
?>
99
<p><?= $block->escapeHtml(__('You have signed out and will go to our homepage in 5 seconds.')) ?></p>
10-
<script>
11-
require([
12-
"jquery",
13-
"mage/mage"
14-
], function($){
15-
16-
$($.mage.redirect("<?= $block->escapeJs($block->escapeUrl($block->getUrl())) ?>", "assign", 5000));
17-
18-
});
10+
<script type="text/x-magento-init">
11+
{
12+
"*": {
13+
"Magento_Customer/js/logout-redirect": {
14+
"url": "<?= $block->escapeJs($block->escapeUrl($block->getUrl())) ?>"
15+
}
16+
}
17+
}
1918
</script>
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
/**
2+
* Copyright © Magento, Inc. All rights reserved.
3+
* See COPYING.txt for license details.
4+
*/
5+
6+
define([
7+
'jquery',
8+
'mage/mage'
9+
], function ($) {
10+
'use strict';
11+
12+
return function (data) {
13+
$($.mage.redirect(data.url, 'assign', 5000));
14+
};
15+
});

app/code/Magento/Sales/Controller/Adminhtml/Order/Create/LoadBlock.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,10 +55,10 @@ public function execute()
5555
$this->_initSession()->_processData();
5656
} catch (\Magento\Framework\Exception\LocalizedException $e) {
5757
$this->_reloadQuote();
58-
$this->messageManager->addError($e->getMessage());
58+
$this->messageManager->addErrorMessage($e->getMessage());
5959
} catch (\Exception $e) {
6060
$this->_reloadQuote();
61-
$this->messageManager->addException($e, $e->getMessage());
61+
$this->messageManager->addExceptionMessage($e, $e->getMessage());
6262
}
6363

6464
$asJson = $request->getParam('json');

app/code/Magento/Sales/Controller/Adminhtml/Order/Create/Save.php

Lines changed: 16 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -3,23 +3,26 @@
33
* Copyright © Magento, Inc. All rights reserved.
44
* See COPYING.txt for license details.
55
*/
6+
67
namespace Magento\Sales\Controller\Adminhtml\Order\Create;
78

9+
use Magento\Framework\Controller\ResultFactory;
810
use Magento\Framework\Exception\PaymentException;
911

1012
class Save extends \Magento\Sales\Controller\Adminhtml\Order\Create
1113
{
1214
/**
1315
* Saving quote and create order
1416
*
15-
* @return \Magento\Backend\Model\View\Result\Forward|\Magento\Backend\Model\View\Result\Redirect
17+
* @return \Magento\Framework\Controller\ResultInterface
1618
*
1719
* @SuppressWarnings(PHPMD.CyclomaticComplexity)
1820
*/
1921
public function execute()
2022
{
21-
/** @var \Magento\Backend\Model\View\Result\Redirect $resultRedirect */
22-
$resultRedirect = $this->resultRedirectFactory->create();
23+
$path = 'sales/*/';
24+
$pathParams = [];
25+
2326
try {
2427
// check if the creation of a new customer is allowed
2528
if (!$this->_authorization->isAllowed('Magento_Customer::manage')
@@ -49,31 +52,30 @@ public function execute()
4952
->createOrder();
5053

5154
$this->_getSession()->clearStorage();
52-
$this->messageManager->addSuccess(__('You created the order.'));
55+
$this->messageManager->addSuccessMessage(__('You created the order.'));
5356
if ($this->_authorization->isAllowed('Magento_Sales::actions_view')) {
54-
$resultRedirect->setPath('sales/order/view', ['order_id' => $order->getId()]);
57+
$pathParams = ['order_id' => $order->getId()];
58+
$path = 'sales/order/view';
5559
} else {
56-
$resultRedirect->setPath('sales/order/index');
60+
$path = 'sales/order/index';
5761
}
5862
} catch (PaymentException $e) {
5963
$this->_getOrderCreateModel()->saveQuote();
6064
$message = $e->getMessage();
6165
if (!empty($message)) {
62-
$this->messageManager->addError($message);
66+
$this->messageManager->addErrorMessage($message);
6367
}
64-
$resultRedirect->setPath('sales/*/');
6568
} catch (\Magento\Framework\Exception\LocalizedException $e) {
6669
// customer can be created before place order flow is completed and should be stored in current session
67-
$this->_getSession()->setCustomerId($this->_getSession()->getQuote()->getCustomerId());
70+
$this->_getSession()->setCustomerId((int)$this->_getSession()->getQuote()->getCustomerId());
6871
$message = $e->getMessage();
6972
if (!empty($message)) {
70-
$this->messageManager->addError($message);
73+
$this->messageManager->addErrorMessage($message);
7174
}
72-
$resultRedirect->setPath('sales/*/');
7375
} catch (\Exception $e) {
74-
$this->messageManager->addException($e, __('Order saving error: %1', $e->getMessage()));
75-
$resultRedirect->setPath('sales/*/');
76+
$this->messageManager->addExceptionMessage($e, __('Order saving error: %1', $e->getMessage()));
7677
}
77-
return $resultRedirect;
78+
79+
return $this->resultRedirectFactory->create()->setPath($path, $pathParams);
7880
}
7981
}

app/code/Magento/Sales/Model/AdminOrder/Create.php

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1948,21 +1948,17 @@ public function createOrder()
19481948
*/
19491949
protected function _validate()
19501950
{
1951-
$customerId = $this->getSession()->getCustomerId();
1952-
if ($customerId === null) {
1953-
throw new \Magento\Framework\Exception\LocalizedException(__('Please select a customer'));
1954-
}
1955-
19561951
if (!$this->getSession()->getStore()->getId()) {
19571952
throw new \Magento\Framework\Exception\LocalizedException(__('Please select a store'));
19581953
}
19591954
$items = $this->getQuote()->getAllItems();
19601955

1961-
if (count($items) == 0) {
1956+
if (count($items) === 0) {
19621957
$this->_errors[] = __('Please specify order items.');
19631958
}
19641959

19651960
foreach ($items as $item) {
1961+
/** @var \Magento\Quote\Model\Quote\Item $item */
19661962
$messages = $item->getMessage(false);
19671963
if ($item->getHasError() && is_array($messages) && !empty($messages)) {
19681964
$this->_errors = array_merge($this->_errors, $messages);
@@ -1991,7 +1987,7 @@ protected function _validate()
19911987
}
19921988
if (!empty($this->_errors)) {
19931989
foreach ($this->_errors as $error) {
1994-
$this->messageManager->addError($error);
1990+
$this->messageManager->addErrorMessage($error);
19951991
}
19961992
throw new \Magento\Framework\Exception\LocalizedException(__('Validation is failed.'));
19971993
}

app/code/Magento/Ui/Component/Bookmark.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,11 +82,11 @@ public function prepare()
8282
}
8383
}
8484

85-
$this->setData('config', array_replace_recursive($config, $this->getConfiguration($this)));
85+
$this->setData('config', array_replace_recursive($config, $this->getConfiguration()));
8686

8787
parent::prepare();
8888

89-
$jsConfig = $this->getConfiguration($this);
89+
$jsConfig = $this->getConfiguration();
9090
$this->getContext()->addComponentDefinition($this->getComponentName(), $jsConfig);
9191
}
9292
}

app/code/Magento/Ui/Test/Unit/Component/Control/ActionPoolTest.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,8 +83,7 @@ protected function setUp()
8383
$this->items[$this->key] = $this->createPartialMock(\Magento\Ui\Component\Control\Item::class, ['setData']);
8484
$this->actionPool = new ActionPool(
8585
$this->contextMock,
86-
$this->itemFactoryMock,
87-
$this->toolbarBlockMock
86+
$this->itemFactoryMock
8887
);
8988
}
9089

app/code/Magento/Webapi/Model/Soap/Fault.php

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,9 @@ class Fault
3939
const NODE_DETAIL_WRAPPER = 'GenericFault';
4040
/**#@-*/
4141

42-
/**#@-*/
42+
/**
43+
* @var string
44+
*/
4345
protected $_soapFaultCode;
4446

4547
/**
@@ -114,7 +116,7 @@ public function __construct(
114116
\Magento\Framework\Locale\ResolverInterface $localeResolver,
115117
State $appState
116118
) {
117-
$this->_soapCode = $exception->getOriginator();
119+
$this->_soapFaultCode = $exception->getOriginator();
118120
$this->_parameters = $exception->getDetails();
119121
$this->_wrappedErrors = $exception->getErrors();
120122
$this->stackTrace = $exception->getStackTrace() ?: $exception->getTraceAsString();
@@ -194,7 +196,7 @@ public function getDetails()
194196
*/
195197
public function getSoapCode()
196198
{
197-
return $this->_soapCode;
199+
return $this->_soapFaultCode;
198200
}
199201

200202
/**

app/design/frontend/Magento/luma/etc/view.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -231,6 +231,7 @@
231231
<var name="height"></var> <!-- Height of magnifier block -->
232232
<var name="eventType">hover</var> <!-- Action that atcivates zoom (hover/click) -->
233233
<var name="enabled">false</var> <!-- Turn on/off magnifier (true/false) -->
234+
<var name="mode">outside</var> <!-- Zoom type (outside/inside) -->
234235
</var>
235236

236237
<var name="breakpoints">

lib/web/mage/dropdowns.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -127,11 +127,9 @@ define([
127127
}
128128

129129
elem.on('click.toggleDropdown', function () {
130-
var el;
130+
var el = actionElem;
131131

132132
if (options.autoclose === true) {
133-
el = actionElem;
134-
135133
actionElem = $();
136134
$(document).trigger('click.hideDropdown');
137135
actionElem = el;

0 commit comments

Comments
 (0)