Skip to content

Commit 8ae9620

Browse files
committed
Merge remote-tracking branch 'origin/2.2-develop' into MAGETWO-85699
2 parents fdd4952 + 523a83e commit 8ae9620

File tree

44 files changed

+886
-314
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

44 files changed

+886
-314
lines changed

app/code/Magento/Authorizenet/Model/Directpost.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -832,6 +832,7 @@ protected function declineOrder(\Magento\Sales\Model\Order $order, $message = ''
832832
->void($response);
833833
}
834834
$order->registerCancellation($message)->save();
835+
$this->_eventManager->dispatch('order_cancel_after', ['order' => $order ]);
835836
} catch (\Exception $e) {
836837
//quiet decline
837838
$this->getPsrLogger()->critical($e);

app/code/Magento/Backend/Block/Widget/Grid/Massaction/AbstractMassaction.php

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
namespace Magento\Backend\Block\Widget\Grid\Massaction;
77

88
use Magento\Backend\Block\Widget\Grid\Massaction\VisibilityCheckerInterface as VisibilityChecker;
9+
use Magento\Framework\Data\Collection\AbstractDb;
910
use Magento\Framework\DataObject;
1011

1112
/**
@@ -51,7 +52,7 @@ public function __construct(
5152
}
5253

5354
/**
54-
* @return void
55+
* @inheritdoc
5556
*/
5657
protected function _construct()
5758
{
@@ -216,6 +217,7 @@ public function getGridJsObjectName()
216217
* Retrieve JSON string of selected checkboxes
217218
*
218219
* @return string
220+
* @SuppressWarnings(PHPMD.RequestAwareBlockMethod)
219221
*/
220222
public function getSelectedJson()
221223
{
@@ -230,6 +232,7 @@ public function getSelectedJson()
230232
* Retrieve array of selected checkboxes
231233
*
232234
* @return string[]
235+
* @SuppressWarnings(PHPMD.RequestAwareBlockMethod)
233236
*/
234237
public function getSelected()
235238
{
@@ -251,6 +254,8 @@ public function getApplyButtonHtml()
251254
}
252255

253256
/**
257+
* Get mass action javascript code.
258+
*
254259
* @return string
255260
*/
256261
public function getJavaScript()
@@ -267,6 +272,8 @@ public function getJavaScript()
267272
}
268273

269274
/**
275+
* Get grid ids in JSON format.
276+
*
270277
* @return string
271278
*/
272279
public function getGridIdsJson()
@@ -282,7 +289,11 @@ public function getGridIdsJson()
282289
} else {
283290
$massActionIdField = $this->getParentBlock()->getMassactionIdField();
284291
}
285-
292+
if ($allIdsCollection instanceof AbstractDb) {
293+
$allIdsCollection->getSelect()->limit();
294+
$allIdsCollection->clear();
295+
}
296+
286297
$gridIds = $allIdsCollection->setPageSize(0)->getColumnValues($massActionIdField);
287298
if (!empty($gridIds)) {
288299
return join(",", $gridIds);
@@ -291,6 +302,8 @@ public function getGridIdsJson()
291302
}
292303

293304
/**
305+
* Get Html id.
306+
*
294307
* @return string
295308
*/
296309
public function getHtmlId()
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
/**
4+
* Copyright © Magento, Inc. All rights reserved.
5+
* See COPYING.txt for license details.
6+
*/
7+
-->
8+
9+
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
11+
<actionGroup name="CustomerLogoutStorefrontByMenuItemsActionGroup">
12+
<conditionalClick selector="{{StorefrontPanelHeaderSection.customerWelcome}}"
13+
dependentSelector="{{StorefrontPanelHeaderSection.customerWelcomeMenu}}"
14+
visible="false"
15+
stepKey="clickHeaderCustomerMenuButton" />
16+
<click selector="{{StorefrontPanelHeaderSection.customerLogoutLink}}" stepKey="clickSignOutButton" />
17+
</actionGroup>
18+
</actionGroups>

app/code/Magento/Customer/Test/Mftf/Section/StorefrontPanelHeaderSection.xml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,12 @@
77
-->
88

99
<sections xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10-
xsi:noNamespaceSchemaLocation="../../../../../../../dev/tests/acceptance/vendor/magento/magento2-functional-testing-framework/src/Magento/FunctionalTestingFramework/Page/etc/SectionObject.xsd">
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd">
1111
<section name="StorefrontPanelHeaderSection">
1212
<element name="createAnAccountLink" type="select" selector=".panel.header li:nth-child(3)"/>
13+
<element name="customerWelcome" type="text" selector=".panel.header .customer-welcome"/>
14+
<element name="customerWelcomeMenu" type="text" selector=".panel.header .customer-welcome .customer-menu"/>
15+
<element name="customerLogoutLink" type="text" selector=".panel.header .customer-welcome .customer-menu .authorization-link a" timeout="30"/>
1316
<element name="welcomeMessage" type="text" selector=".greet.welcome span"/>
1417
<element name="notYouLink" type="button" selector=".greet.welcome span a"/>
1518
</section>

app/code/Magento/Deploy/Collector/Collector.php

Lines changed: 39 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,11 @@
55
*/
66
namespace Magento\Deploy\Collector;
77

8-
use Magento\Deploy\Source\SourcePool;
98
use Magento\Deploy\Package\Package;
109
use Magento\Deploy\Package\PackageFactory;
10+
use Magento\Deploy\Source\SourcePool;
11+
use Magento\Deploy\Package\PackageFile;
12+
use Magento\Framework\Module\Manager;
1113
use Magento\Framework\View\Asset\PreProcessor\FileNameResolver;
1214

1315
/**
@@ -44,6 +46,9 @@ class Collector implements CollectorInterface
4446
*/
4547
private $packageFactory;
4648

49+
/** @var \Magento\Framework\Module\Manager */
50+
private $moduleManager;
51+
4752
/**
4853
* Default values for package primary identifiers
4954
*
@@ -61,15 +66,19 @@ class Collector implements CollectorInterface
6166
* @param SourcePool $sourcePool
6267
* @param FileNameResolver $fileNameResolver
6368
* @param PackageFactory $packageFactory
69+
* @param Manager $moduleManager
6470
*/
6571
public function __construct(
6672
SourcePool $sourcePool,
6773
FileNameResolver $fileNameResolver,
68-
PackageFactory $packageFactory
74+
PackageFactory $packageFactory,
75+
Manager $moduleManager = null
6976
) {
7077
$this->sourcePool = $sourcePool;
7178
$this->fileNameResolver = $fileNameResolver;
7279
$this->packageFactory = $packageFactory;
80+
$this->moduleManager = $moduleManager ?: \Magento\Framework\App\ObjectManager::getInstance()
81+
->get(Manager::class);
7382
}
7483

7584
/**
@@ -81,19 +90,11 @@ public function collect()
8190
foreach ($this->sourcePool->getAll() as $source) {
8291
$files = $source->get();
8392
foreach ($files as $file) {
84-
$file->setDeployedFileName($this->fileNameResolver->resolve($file->getFileName()));
85-
$params = [
86-
'area' => $file->getArea(),
87-
'theme' => $file->getTheme(),
88-
'locale' => $file->getLocale(),
89-
'module' => $file->getModule(),
90-
'isVirtual' => (!$file->getLocale() || !$file->getTheme() || !$file->getArea())
91-
];
92-
foreach ($this->packageDefaultValues as $name => $value) {
93-
if (!isset($params[$name])) {
94-
$params[$name] = $value;
95-
}
93+
if ($file->getModule() && !$this->moduleManager->isEnabled($file->getModule())) {
94+
continue;
9695
}
96+
$file->setDeployedFileName($this->fileNameResolver->resolve($file->getFileName()));
97+
$params = $this->getParams($file);
9798
$packagePath = "{$params['area']}/{$params['theme']}/{$params['locale']}";
9899
if (!isset($packages[$packagePath])) {
99100
$packages[$packagePath] = $this->packageFactory->create($params);
@@ -105,4 +106,28 @@ public function collect()
105106
}
106107
return $packages;
107108
}
109+
110+
/**
111+
* Retrieve package params.
112+
*
113+
* @param PackageFile $file
114+
* @return array
115+
*/
116+
private function getParams(PackageFile $file)
117+
{
118+
$params = [
119+
'area' => $file->getArea(),
120+
'theme' => $file->getTheme(),
121+
'locale' => $file->getLocale(),
122+
'module' => $file->getModule(),
123+
'isVirtual' => (!$file->getLocale() || !$file->getTheme() || !$file->getArea())
124+
];
125+
foreach ($this->packageDefaultValues as $name => $value) {
126+
if (!isset($params[$name])) {
127+
$params[$name] = $value;
128+
}
129+
}
130+
131+
return $params;
132+
}
108133
}

app/code/Magento/ImportExport/Controller/Adminhtml/Import/Start.php

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,11 @@
77

88
use Magento\ImportExport\Controller\Adminhtml\ImportResult as ImportResultController;
99
use Magento\Framework\Controller\ResultFactory;
10+
use Magento\ImportExport\Model\Import;
1011

12+
/**
13+
* Controller responsible for initiating the import process.
14+
*/
1115
class Start extends ImportResultController
1216
{
1317
/**
@@ -62,6 +66,11 @@ public function execute()
6266

6367
$this->importModel->setData($data);
6468
$errorAggregator = $this->importModel->getErrorAggregator();
69+
$errorAggregator->initValidationStrategy(
70+
$this->importModel->getData(Import::FIELD_NAME_VALIDATION_STRATEGY),
71+
$this->importModel->getData(Import::FIELD_NAME_ALLOWED_ERROR_COUNT)
72+
);
73+
6574
try {
6675
$this->importModel->importSource();
6776
} catch (\Exception $e) {

app/code/Magento/Newsletter/view/adminhtml/templates/preview/iframeswitcher.phtml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,14 @@
1616
</div>
1717
<?php endif;?>
1818
</div>
19-
<iframe name="preview_iframe" id="preview_iframe" frameborder="0" title="<?= $block->escapeHtmlAttr(__('Preview')) ?>" width="100%"></iframe>
19+
<iframe
20+
name="preview_iframe"
21+
id="preview_iframe"
22+
frameborder="0"
23+
title="<?= $block->escapeHtmlAttr(__('Preview')) ?>"
24+
width="100%"
25+
sandbox="allow-forms allow-pointer-lock allow-scripts">
26+
</iframe>
2027
<?= $block->getChildHtml('preview_form') ?>
2128
</div>
2229

app/code/Magento/Persistent/Block/Header/Additional.php

Lines changed: 42 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,10 @@
55
*/
66
namespace Magento\Persistent\Block\Header;
77

8+
use Magento\Framework\App\ObjectManager;
9+
use Magento\Framework\Serialize\Serializer\Json;
10+
use Magento\Persistent\Helper\Data;
11+
812
/**
913
* Remember Me block
1014
*
@@ -30,27 +34,46 @@ class Additional extends \Magento\Framework\View\Element\Html\Link
3034
protected $customerRepository;
3135

3236
/**
33-
* Constructor
34-
*
37+
* @var string
38+
*/
39+
protected $_template = 'Magento_Persistent::additional.phtml';
40+
41+
/**
42+
* @var Json
43+
*/
44+
private $jsonSerializer;
45+
46+
/**
47+
* @var Data
48+
*/
49+
private $persistentHelper;
50+
51+
/**
3552
* @param \Magento\Framework\View\Element\Template\Context $context
3653
* @param \Magento\Customer\Helper\View $customerViewHelper
3754
* @param \Magento\Persistent\Helper\Session $persistentSessionHelper
3855
* @param \Magento\Customer\Api\CustomerRepositoryInterface $customerRepository
3956
* @param array $data
57+
* @param Json|null $jsonSerializer
58+
* @param Data|null $persistentHelper
4059
*/
4160
public function __construct(
4261
\Magento\Framework\View\Element\Template\Context $context,
4362
\Magento\Customer\Helper\View $customerViewHelper,
4463
\Magento\Persistent\Helper\Session $persistentSessionHelper,
4564
\Magento\Customer\Api\CustomerRepositoryInterface $customerRepository,
46-
array $data = []
65+
array $data = [],
66+
Json $jsonSerializer = null,
67+
Data $persistentHelper = null
4768
) {
4869
$this->isScopePrivate = true;
4970
$this->_customerViewHelper = $customerViewHelper;
5071
$this->_persistentSessionHelper = $persistentSessionHelper;
5172
$this->customerRepository = $customerRepository;
5273
parent::__construct($context, $data);
5374
$this->_isScopePrivate = true;
75+
$this->jsonSerializer = $jsonSerializer ?: ObjectManager::getInstance()->get(Json::class);
76+
$this->persistentHelper = $persistentHelper ?: ObjectManager::getInstance()->get(Data::class);
5477
}
5578

5679
/**
@@ -64,17 +87,25 @@ public function getHref()
6487
}
6588

6689
/**
67-
* Render additional header html
90+
* @return int
91+
*/
92+
public function getCustomerId()
93+
{
94+
return $this->_persistentSessionHelper->getSession()->getCustomerId();
95+
}
96+
97+
/**
98+
* Get persistent config.
6899
*
69100
* @return string
70101
*/
71-
protected function _toHtml()
102+
public function getConfig()
72103
{
73-
if ($this->_persistentSessionHelper->getSession()->getCustomerId()) {
74-
return '<span><a ' . $this->getLinkAttributes() . ' >' . __('Not you?')
75-
. '</a></span>';
76-
}
77-
78-
return '';
104+
return
105+
$this->jsonSerializer->serialize(
106+
[
107+
'expirationLifetime' => $this->persistentHelper->getLifeTime(),
108+
]
109+
);
79110
}
80111
}

0 commit comments

Comments
 (0)