Skip to content
This repository was archived by the owner on Apr 29, 2019. It is now read-only.

Commit 2ad32d9

Browse files
authored
🔃 [EngCom] Public Pull Requests - 2.3-develop
Accepted Public Pull Requests: - magento/magento2#12937: [Backport 2.3-develop] Handle multiple errors in customer address validation when shown in adminhtml customer edit page (by @adrian-martinez-interactiv4) - magento-engcom/magento2ce#1150: magento/magento2#NONE: Fix vault_payment_token install script type where column defaults were not set (PR #12965 forwardport 2.3) (by @p-bystritsky) - #95: MAGETWO-49985: product custom options export in reverse order fixed (by @umarch-rltsquare)
2 parents e150a7e + 6a71b6d commit 2ad32d9

File tree

5 files changed

+72
-13
lines changed

5 files changed

+72
-13
lines changed

app/code/Magento/CatalogImportExport/Model/Export/Product.php

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1315,16 +1315,12 @@ protected function getCustomOptionsData($productIds)
13151315
}
13161316
$options = $this->_optionColFactory->create();
13171317
/* @var \Magento\Catalog\Model\ResourceModel\Product\Option\Collection $options*/
1318-
$options->addOrder('sort_order');
1319-
$options->reset()->addOrder('sort_order')->addTitleToResult(
1320-
$storeId
1321-
)->addPriceToResult(
1322-
$storeId
1323-
)->addProductToFilter(
1324-
$productIds
1325-
)->addValuesToResult(
1326-
$storeId
1327-
);
1318+
$options->reset();
1319+
$options->addOrder('sort_order', 'ASC');
1320+
$options->addTitleToResult($storeId);
1321+
$options->addPriceToResult($storeId);
1322+
$options->addProductToFilter($productIds);
1323+
$options->addValuesToResult($storeId);
13281324

13291325
foreach ($options as $option) {
13301326
$row = [];

app/code/Magento/Customer/Controller/Adminhtml/Index/Save.php

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@
1313
use Magento\Customer\Model\Metadata\Form;
1414
use Magento\Framework\Exception\LocalizedException;
1515

16+
/**
17+
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
18+
*/
1619
class Save extends \Magento\Customer\Controller\Adminhtml\Index
1720
{
1821
/**
@@ -268,6 +271,15 @@ public function execute()
268271
$this->_addSessionErrorMessages($messages);
269272
$this->_getSession()->setCustomerFormData($originalRequestData);
270273
$returnToEdit = true;
274+
} catch (\Magento\Framework\Exception\AbstractAggregateException $exception) {
275+
$errors = $exception->getErrors();
276+
$messages = [];
277+
foreach ($errors as $error) {
278+
$messages[] = $error->getMessage();
279+
}
280+
$this->_addSessionErrorMessages($messages);
281+
$this->_getSession()->setCustomerFormData($originalRequestData);
282+
$returnToEdit = true;
271283
} catch (LocalizedException $exception) {
272284
$this->_addSessionErrorMessages($exception->getMessage());
273285
$this->_getSession()->setCustomerFormData($originalRequestData);

app/code/Magento/Vault/Setup/InstallSchema.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,13 +90,13 @@ public function install(SchemaSetupInterface $setup, ModuleContextInterface $con
9090
'is_active',
9191
Table::TYPE_BOOLEAN,
9292
null,
93-
['nullable' => false, 'dafault' => true],
93+
['nullable' => false, 'default' => true],
9494
'Is active flag'
9595
)->addColumn(
9696
'is_visible',
9797
Table::TYPE_BOOLEAN,
9898
null,
99-
['nullable' => false, 'dafault' => true],
99+
['nullable' => false, 'default' => true],
100100
'Is visible flag'
101101
)->addIndex(
102102
$setup->getIdxName(
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
<?php
2+
/**
3+
* Copyright © Magento, Inc. All rights reserved.
4+
* See COPYING.txt for license details.
5+
*/
6+
7+
namespace Magento\Vault\Setup;
8+
9+
use Magento\Framework\Setup\ModuleContextInterface;
10+
use Magento\Framework\Setup\SchemaSetupInterface;
11+
use Magento\Framework\Setup\UpgradeSchemaInterface;
12+
use Magento\Framework\DB\Ddl\Table;
13+
14+
/**
15+
* Upgrade the Vault module DB scheme
16+
*/
17+
class UpgradeSchema implements UpgradeSchemaInterface
18+
{
19+
/**
20+
* @inheritdoc
21+
*/
22+
public function upgrade(SchemaSetupInterface $setup, ModuleContextInterface $context)
23+
{
24+
$setup->startSetup();
25+
if (version_compare($context->getVersion(), '2.0.3', '<')) {
26+
$this->upgradeTokenTableDefaultValues($setup);
27+
}
28+
$setup->endSetup();
29+
}
30+
31+
/**
32+
* @param SchemaSetupInterface $setup
33+
* @return void
34+
*/
35+
private function upgradeTokenTableDefaultValues(SchemaSetupInterface $setup)
36+
{
37+
$columns = ['is_active', 'is_visible'];
38+
39+
foreach ($columns as $columnName) {
40+
$setup->getConnection()->modifyColumn(
41+
$setup->getTable(InstallSchema::PAYMENT_TOKEN_TABLE),
42+
$columnName,
43+
[
44+
'type' => Table::TYPE_BOOLEAN,
45+
'nullable' => false,
46+
'default' => '1'
47+
]
48+
);
49+
}
50+
}
51+
}

app/code/Magento/Vault/etc/module.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
*/
77
-->
88
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd">
9-
<module name="Magento_Vault" setup_version="2.0.2">
9+
<module name="Magento_Vault" setup_version="2.0.3">
1010
<sequence>
1111
<module name="Magento_Sales"/>
1212
<module name="Magento_Store"/>

0 commit comments

Comments
 (0)