Skip to content

Commit 6d8e725

Browse files
authored
Merge pull request #3891 from magento-arcticfoxes/2.3-develop-pr
[2.3-develop] Sync with 2.3.1-release
2 parents a4039fe + 9c276d7 commit 6d8e725

File tree

11 files changed

+123
-9
lines changed

11 files changed

+123
-9
lines changed

app/code/Magento/Elasticsearch/Model/Adapter/FieldMapper/Product/FieldProvider/DynamicField.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,10 +137,12 @@ public function getFields(array $context = []): array
137137
$searchCriteria = $this->searchCriteriaBuilder->create();
138138
$groups = $this->groupRepository->getList($searchCriteria)->getItems();
139139
$priceAttribute = $this->attributeAdapterProvider->getByAttributeCode('price');
140+
$ctx = isset($context['websiteId']) ? ['websiteId' => $context['websiteId']] : [];
140141
foreach ($groups as $group) {
142+
$ctx['customerGroupId'] = $group->getId();
141143
$groupPriceKey = $this->fieldNameResolver->getFieldName(
142144
$priceAttribute,
143-
['customerGroupId' => $group->getId(), 'websiteId' => $context['websiteId']]
145+
$ctx
144146
);
145147
$allAttributes[$groupPriceKey] = [
146148
'type' => $this->fieldTypeConverter->convert(FieldTypeConverterInterface::INTERNAL_DATA_TYPE_FLOAT),

app/code/Magento/Elasticsearch6/etc/di.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@
158158
<type name="Magento\Search\Model\Search\PageSizeProvider">
159159
<arguments>
160160
<argument name="pageSizeBySearchEngine" xsi:type="array">
161-
<item name="elasticsearch6" xsi:type="number">2147483647</item>
161+
<item name="elasticsearch6" xsi:type="number">10000</item>
162162
</argument>
163163
</arguments>
164164
</type>

app/code/Magento/Sales/Block/Adminhtml/Order/Create/Form/Account.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -132,9 +132,7 @@ protected function _prepareForm()
132132
$this->_addAttributesToForm($attributes, $fieldset);
133133

134134
$this->_form->addFieldNameSuffix('order[account]');
135-
136-
$formValues = $this->extractValuesFromAttributes($attributes);
137-
$this->_form->setValues($formValues);
135+
$this->_form->setValues($this->extractValuesFromAttributes($attributes));
138136

139137
return $this;
140138
}
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
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+
<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd">
11+
<test name="AdminChangeCustomerGroupInNewOrder">
12+
<annotations>
13+
<title value="Customer account group cannot be selected while creating a new customer in order"/>
14+
<stories value="MC-15290: Customer account group cannot be selected while creating a new customer in order"/>
15+
<description value="Customer account group cannot be selected while creating a new customer in order"/>
16+
<severity value="MAJOR"/>
17+
<testCaseId value="MC-15290"/>
18+
<useCaseId value="MC-15289"/>
19+
<group value="sales"/>
20+
</annotations>
21+
22+
<before>
23+
<actionGroup ref="LoginAsAdmin" stepKey="login"/>
24+
</before>
25+
<after>
26+
<actionGroup ref="logout" stepKey="logout"/>
27+
</after>
28+
29+
<actionGroup ref="navigateToNewOrderPageNewCustomerSingleStore" stepKey="openNewOrder"/>
30+
<selectOption selector="{{AdminOrderFormAccountSection.group}}" userInput="Retailer" stepKey="selectCustomerGroup"/>
31+
<waitForPageLoad stepKey="waitForPageLoad"/>
32+
<grabValueFrom selector="{{AdminOrderFormAccountSection.group}}" stepKey="grabGroupValue"/>
33+
<assertEquals stepKey="assertValueIsStillSelected">
34+
<actualResult type="variable">$grabGroupValue</actualResult>
35+
<expectedResult type="string">3</expectedResult>
36+
</assertEquals>
37+
</test>
38+
</tests>

app/code/Magento/Store/Test/Mftf/ActionGroup/DeleteCustomWebsiteActionGroup.xml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,15 +13,14 @@
1313
</arguments>
1414
<amOnPage url="{{AdminSystemStorePage.url}}" stepKey="amOnTheStorePage"/>
1515
<click selector="{{AdminStoresGridSection.resetButton}}" stepKey="clickOnResetButton"/>
16-
<waitForPageLoad stepKey="waitForPageLoadAfterResetButtonClicked" time="10"/>
1716
<fillField userInput="{{websiteName}}" selector="{{AdminStoresGridSection.websiteFilterTextField}}" stepKey="fillSearchWebsiteField"/>
1817
<click selector="{{AdminStoresGridSection.searchButton}}" stepKey="clickSearchButton" />
19-
<waitForPageLoad stepKey="waitForPageLoadAfterSearch" time="10"/>
2018
<see userInput="{{websiteName}}" selector="{{AdminStoresGridSection.websiteNameInFirstRow}}" stepKey="verifyThatCorrectWebsiteFound"/>
2119
<click selector="{{AdminStoresGridSection.websiteNameInFirstRow}}" stepKey="clickEditExistingWebsite"/>
22-
20+
<waitForPageLoad stepKey="waitForPageLoadAfterWebsiteSelected" time="30"/>
2321
<click selector="{{AdminStoresMainActionsSection.deleteButton}}" stepKey="clickDeleteWebsiteButtonOnEditStorePage"/>
2422
<selectOption userInput="No" selector="{{AdminStoresDeleteWebsiteSection.createDbBackup}}" stepKey="setCreateDbBackupToNo"/>
2523
<click selector="{{AdminStoresDeleteWebsiteSection.deleteButton}}" stepKey="clickDeleteButtonOnDeleteWebsitePage"/>
24+
<see selector="{{AdminMessagesSection.successMessage}}" userInput="You deleted the website." stepKey="checkSuccessMessage"/>
2625
</actionGroup>
2726
</actionGroups>

app/code/Magento/Store/Test/Mftf/Section/AdminStoresDeleteWebsiteSection.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,6 @@
88
<sections xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd">
99
<section name="AdminStoresDeleteWebsiteSection">
1010
<element name="createDbBackup" type="select" selector="#store_create_backup"/>
11-
<element name="deleteButton" type="button" selector="#delete" timeout="30"/>
11+
<element name="deleteButton" type="button" selector="#delete" timeout="120"/>
1212
</section>
1313
</sections>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
<?xml version="1.0"?>
2+
<!--
3+
/**
4+
* Copyright © Magento, Inc. All rights reserved.
5+
* See COPYING.txt for license details.
6+
*/
7+
-->
8+
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd">
9+
<module name="Magento_TestSetupDeclarationModule1"/>
10+
</config>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<?xml version="1.0"?>
2+
<!--
3+
/**
4+
* Copyright © Magento, Inc. All rights reserved.
5+
* See COPYING.txt for license details.
6+
*/
7+
-->
8+
<schema xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
9+
xsi:noNamespaceSchemaLocation="urn:magento:framework:Setup/Declaration/Schema/etc/schema.xsd">
10+
<table name="reference_table" disabled="true"/>
11+
</schema>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
<?xml version="1.0"?>
2+
<!--
3+
/**
4+
* Copyright © Magento, Inc. All rights reserved.
5+
* See COPYING.txt for license details.
6+
*/
7+
-->
8+
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd">
9+
<module name="Magento_TestSetupDeclarationModule3"/>
10+
</config>

dev/tests/setup-integration/testsuite/Magento/Setup/DeclarativeInstallerTest.php

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -249,6 +249,45 @@ public function testInstallationWithDroppingTables()
249249
self::assertEquals($this->getData(), $shardData);
250250
}
251251

252+
/**
253+
* @moduleName Magento_TestSetupDeclarationModule1
254+
* @moduleName Magento_TestSetupDeclarationModule3
255+
*/
256+
public function testInstallationWithDroppingTablesFromSecondaryModule()
257+
{
258+
$modules = [
259+
'Magento_TestSetupDeclarationModule1',
260+
'Magento_TestSetupDeclarationModule3',
261+
];
262+
263+
$this->moduleManager->updateRevision(
264+
'Magento_TestSetupDeclarationModule3',
265+
'drop_table_with_external_dependency',
266+
'db_schema.xml',
267+
'etc'
268+
);
269+
270+
foreach ($modules as $moduleName) {
271+
$this->moduleManager->updateRevision(
272+
$moduleName,
273+
'without_setup_version',
274+
'module.xml',
275+
'etc'
276+
);
277+
}
278+
279+
try {
280+
$this->cliCommand->install($modules);
281+
} catch (\Exception $e) {
282+
$installException = $e->getPrevious();
283+
self::assertSame(1, $installException->getCode());
284+
self::assertContains(
285+
'The reference table named "reference_table" is disabled',
286+
$installException->getMessage()
287+
);
288+
}
289+
}
290+
252291
/**
253292
* @moduleName Magento_TestSetupDeclarationModule1
254293
* @dataProviderFromFile Magento/TestSetupDeclarationModule1/fixture/declarative_installer/rollback.php

lib/internal/Magento/Framework/Setup/Declaration/Schema/Declaration/SchemaBuilder.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -350,6 +350,13 @@ private function processConstraints(array $tableData, string $resource, Schema $
350350
if ($constraintData['type'] === 'foreign') {
351351
$constraintData['column'] = $this->getColumnByName($constraintData['column'], $table);
352352
$referenceTableData = $this->tablesData[$constraintData['referenceTable']];
353+
354+
if ($this->isDisabled($referenceTableData)) {
355+
throw new \LogicException(
356+
sprintf('The reference table named "%s" is disabled', $referenceTableData['name'])
357+
);
358+
}
359+
353360
//If we are referenced to the same table we need to specify it
354361
//Get table name from resource connection regarding prefix settings
355362
$refTableName = $this->resourceConnection->getTableName($referenceTableData['name']);

0 commit comments

Comments
 (0)