Skip to content

Commit

Permalink
🔃 [EngCom] Public Pull Requests - 2.3-develop
Browse files Browse the repository at this point in the history
Accepted Public Pull Requests:
 - #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)
 - magento-engcom/import-export-improvements#95: MAGETWO-49985: product custom options export in reverse order fixed (by @umarch-rltsquare)
  • Loading branch information
magento-team authored Jan 10, 2018
2 parents e150a7e + 6a71b6d commit 2ad32d9
Show file tree
Hide file tree
Showing 5 changed files with 72 additions and 13 deletions.
16 changes: 6 additions & 10 deletions app/code/Magento/CatalogImportExport/Model/Export/Product.php
Original file line number Diff line number Diff line change
Expand Up @@ -1315,16 +1315,12 @@ protected function getCustomOptionsData($productIds)
}
$options = $this->_optionColFactory->create();
/* @var \Magento\Catalog\Model\ResourceModel\Product\Option\Collection $options*/
$options->addOrder('sort_order');
$options->reset()->addOrder('sort_order')->addTitleToResult(
$storeId
)->addPriceToResult(
$storeId
)->addProductToFilter(
$productIds
)->addValuesToResult(
$storeId
);
$options->reset();
$options->addOrder('sort_order', 'ASC');
$options->addTitleToResult($storeId);
$options->addPriceToResult($storeId);
$options->addProductToFilter($productIds);
$options->addValuesToResult($storeId);

foreach ($options as $option) {
$row = [];
Expand Down
12 changes: 12 additions & 0 deletions app/code/Magento/Customer/Controller/Adminhtml/Index/Save.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@
use Magento\Customer\Model\Metadata\Form;
use Magento\Framework\Exception\LocalizedException;

/**
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
*/
class Save extends \Magento\Customer\Controller\Adminhtml\Index
{
/**
Expand Down Expand Up @@ -268,6 +271,15 @@ public function execute()
$this->_addSessionErrorMessages($messages);
$this->_getSession()->setCustomerFormData($originalRequestData);
$returnToEdit = true;
} catch (\Magento\Framework\Exception\AbstractAggregateException $exception) {
$errors = $exception->getErrors();
$messages = [];
foreach ($errors as $error) {
$messages[] = $error->getMessage();
}
$this->_addSessionErrorMessages($messages);
$this->_getSession()->setCustomerFormData($originalRequestData);
$returnToEdit = true;
} catch (LocalizedException $exception) {
$this->_addSessionErrorMessages($exception->getMessage());
$this->_getSession()->setCustomerFormData($originalRequestData);
Expand Down
4 changes: 2 additions & 2 deletions app/code/Magento/Vault/Setup/InstallSchema.php
Original file line number Diff line number Diff line change
Expand Up @@ -90,13 +90,13 @@ public function install(SchemaSetupInterface $setup, ModuleContextInterface $con
'is_active',
Table::TYPE_BOOLEAN,
null,
['nullable' => false, 'dafault' => true],
['nullable' => false, 'default' => true],
'Is active flag'
)->addColumn(
'is_visible',
Table::TYPE_BOOLEAN,
null,
['nullable' => false, 'dafault' => true],
['nullable' => false, 'default' => true],
'Is visible flag'
)->addIndex(
$setup->getIdxName(
Expand Down
51 changes: 51 additions & 0 deletions app/code/Magento/Vault/Setup/UpgradeSchema.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
<?php
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/

namespace Magento\Vault\Setup;

use Magento\Framework\Setup\ModuleContextInterface;
use Magento\Framework\Setup\SchemaSetupInterface;
use Magento\Framework\Setup\UpgradeSchemaInterface;
use Magento\Framework\DB\Ddl\Table;

/**
* Upgrade the Vault module DB scheme
*/
class UpgradeSchema implements UpgradeSchemaInterface
{
/**
* @inheritdoc
*/
public function upgrade(SchemaSetupInterface $setup, ModuleContextInterface $context)
{
$setup->startSetup();
if (version_compare($context->getVersion(), '2.0.3', '<')) {
$this->upgradeTokenTableDefaultValues($setup);
}
$setup->endSetup();
}

/**
* @param SchemaSetupInterface $setup
* @return void
*/
private function upgradeTokenTableDefaultValues(SchemaSetupInterface $setup)
{
$columns = ['is_active', 'is_visible'];

foreach ($columns as $columnName) {
$setup->getConnection()->modifyColumn(
$setup->getTable(InstallSchema::PAYMENT_TOKEN_TABLE),
$columnName,
[
'type' => Table::TYPE_BOOLEAN,
'nullable' => false,
'default' => '1'
]
);
}
}
}
2 changes: 1 addition & 1 deletion app/code/Magento/Vault/etc/module.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
*/
-->
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd">
<module name="Magento_Vault" setup_version="2.0.2">
<module name="Magento_Vault" setup_version="2.0.3">
<sequence>
<module name="Magento_Sales"/>
<module name="Magento_Store"/>
Expand Down

0 comments on commit 2ad32d9

Please sign in to comment.