Skip to content

Commit 2b9d85f

Browse files
[EngCom] Public Pull Requests - 2.3-develop
- merged latest code from mainline branch
2 parents 979f1d9 + 14eeea2 commit 2b9d85f

File tree

44 files changed

+827
-542
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

+827
-542
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/CatalogInventory/etc/events.xml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,6 @@
2727
<event name="sales_model_service_quote_submit_failure">
2828
<observer name="inventory" instance="Magento\CatalogInventory\Observer\RevertQuoteInventoryObserver"/>
2929
</event>
30-
<event name="restore_quote">
31-
<observer name="inventory" instance="Magento\CatalogInventory\Observer\RevertQuoteInventoryObserver"/>
32-
</event>
3330
<event name="sales_order_item_cancel">
3431
<observer name="inventory" instance="Magento\CatalogInventory\Observer\CancelOrderItemObserver"/>
3532
</event>

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/Customer/Setup/UpgradeData.php

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,10 @@ public function upgrade(ModuleDataSetupInterface $setup, ModuleContextInterface
159159
$this->upgradeVersionTwoZeroTwelve($customerSetup);
160160
}
161161

162+
if (version_compare($context->getVersion(), '2.0.13', '<')) {
163+
$this->upgradeVersionTwoZeroThirteen($customerSetup);
164+
}
165+
162166
$indexer = $this->indexerRegistry->get(Customer::CUSTOMER_GRID_INDEXER_ID);
163167
$indexer->reindexAll();
164168
$this->eavConfig->clear();
@@ -663,4 +667,36 @@ private function upgradeCustomerPasswordResetlinkExpirationPeriodConfig($setup)
663667
['path = ?' => \Magento\Customer\Model\Customer::XML_PATH_CUSTOMER_RESET_PASSWORD_LINK_EXPIRATION_PERIOD]
664668
);
665669
}
670+
671+
/**
672+
* @param CustomerSetup $customerSetup
673+
*/
674+
private function upgradeVersionTwoZeroThirteen(CustomerSetup $customerSetup)
675+
{
676+
$entityAttributes = [
677+
'customer_address' => [
678+
'firstname' => [
679+
'input_filter' => 'trim'
680+
],
681+
'lastname' => [
682+
'input_filter' => 'trim'
683+
],
684+
'middlename' => [
685+
'input_filter' => 'trim'
686+
],
687+
],
688+
'customer' => [
689+
'firstname' => [
690+
'input_filter' => 'trim'
691+
],
692+
'lastname' => [
693+
'input_filter' => 'trim'
694+
],
695+
'middlename' => [
696+
'input_filter' => 'trim'
697+
],
698+
],
699+
];
700+
$this->upgradeAttributes($entityAttributes, $customerSetup);
701+
}
666702
}

app/code/Magento/Customer/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_Customer" setup_version="2.0.12">
9+
<module name="Magento_Customer" setup_version="2.0.13">
1010
<sequence>
1111
<module name="Magento_Eav"/>
1212
<module name="Magento_Directory"/>

app/code/Magento/Deploy/Console/Command/SetModeCommand.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,9 @@ protected function execute(InputInterface $input, OutputInterface $output)
101101
$modeController->enableProductionMode();
102102
}
103103
break;
104+
case State::MODE_DEFAULT:
105+
$modeController->enableDefaultMode();
106+
break;
104107
default:
105108
throw new LocalizedException(__('Cannot switch into given mode "%1"', $toMode));
106109
}

app/code/Magento/Deploy/Model/Mode.php

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -167,6 +167,25 @@ public function enableDeveloperMode()
167167
$this->setStoreMode(State::MODE_DEVELOPER);
168168
}
169169

170+
/**
171+
* Enable Default mode.
172+
*
173+
* @return void
174+
*/
175+
public function enableDefaultMode()
176+
{
177+
$this->filesystem->cleanupFilesystem(
178+
[
179+
DirectoryList::CACHE,
180+
DirectoryList::GENERATED_CODE,
181+
DirectoryList::GENERATED_METADATA,
182+
DirectoryList::TMP_MATERIALIZATION_DIR,
183+
DirectoryList::STATIC_VIEW,
184+
]
185+
);
186+
$this->setStoreMode(State::MODE_DEFAULT);
187+
}
188+
170189
/**
171190
* Get current mode information
172191
*

app/code/Magento/Deploy/Test/Unit/Console/Command/SetModeCommandTest.php

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77

88
use Magento\Deploy\Console\Command\SetModeCommand;
99
use Symfony\Component\Console\Tester\CommandTester;
10-
use Magento\Framework\App\State;
1110

1211
/**
1312
* @package Magento\Deploy\Test\Unit\Console\Command
@@ -67,6 +66,18 @@ public function testSetDeveloperMode()
6766
);
6867
}
6968

69+
public function testSetDefaultMode()
70+
{
71+
$this->modeMock->expects($this->once())->method('enableDefaultMode');
72+
73+
$tester = new CommandTester($this->command);
74+
$tester->execute(['mode' => 'default']);
75+
$this->assertContains(
76+
"default mode",
77+
$tester->getDisplay()
78+
);
79+
}
80+
7081
public function testSetProductionSkipCompilation()
7182
{
7283
$this->modeMock->expects($this->once())->method('enableProductionModeMinimal');

app/code/Magento/ReleaseNotification/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ The **Release Notification Module** serves to provide a notification delivery pl
1515
Release notification content is maintained by Magento for each Magento version, edition, and locale. To retrieve the content, a response is returned from a request with the following parameters:
1616

1717
* **version** = The Magento version that the client has installed (ex. 2.3.0).
18-
* **edition** = The Magento edition that the client has installed (ex. Community/Enterprise/B2B).
18+
* **edition** = The Magento edition that the client has installed (ex. Community).
1919
* **locale** = The chosen locale of the admin user (ex. en_US).
2020

2121
The module will make three attempts to retrieve content for the parameters in the order listed:

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(

0 commit comments

Comments
 (0)