Skip to content

Commit 3cd2008

Browse files
committed
Merge remote-tracking branch 'mainline/2.3.1-release' into MC-1426
2 parents 976803b + 079770a commit 3cd2008

File tree

12 files changed

+124
-41
lines changed

12 files changed

+124
-41
lines changed

app/code/Magento/Catalog/Model/Product/Attribute/Backend/Tierprice.php

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -165,19 +165,6 @@ protected function modifyPriceData($object, $data)
165165
/** @var \Magento\Catalog\Model\Product $object */
166166
$data = parent::modifyPriceData($object, $data);
167167
$price = $object->getPrice();
168-
169-
$specialPrice = $object->getSpecialPrice();
170-
$specialPriceFromDate = $object->getSpecialFromDate();
171-
$specialPriceToDate = $object->getSpecialToDate();
172-
$today = time();
173-
174-
if ($specialPrice && ($object->getPrice() > $object->getFinalPrice())) {
175-
if ($today >= strtotime($specialPriceFromDate) && $today <= strtotime($specialPriceToDate) ||
176-
$today >= strtotime($specialPriceFromDate) && $specialPriceToDate === null) {
177-
$price = $specialPrice;
178-
}
179-
}
180-
181168
foreach ($data as $key => $tierPrice) {
182169
$percentageValue = $this->getPercentage($tierPrice);
183170
if ($percentageValue) {

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
@@ -123,10 +123,12 @@ public function getFields(array $context = []): array
123123

124124
$groups = $this->groupRepository->getList($searchCriteria)->getItems();
125125
$priceAttribute = $this->attributeAdapterProvider->getByAttributeCode('price');
126+
$ctx = isset($context['websiteId']) ? ['websiteId' => $context['websiteId']] : [];
126127
foreach ($groups as $group) {
128+
$ctx['customerGroupId'] = $group->getId();
127129
$groupPriceKey = $this->fieldNameResolver->getFieldName(
128130
$priceAttribute,
129-
['customerGroupId' => $group->getId(), 'websiteId' => $context['websiteId']]
131+
$ctx
130132
);
131133
$allAttributes[$groupPriceKey] = [
132134
'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: 2 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -133,8 +133,7 @@ protected function _prepareForm()
133133
$this->_addAttributesToForm($attributes, $fieldset);
134134

135135
$this->_form->addFieldNameSuffix('order[account]');
136-
$storeId = (int)$this->_sessionQuote->getStoreId();
137-
$this->_form->setValues($this->extractValuesFromAttributes($attributes, $storeId));
136+
$this->_form->setValues($this->extractValuesFromAttributes($attributes));
138137

139138
return $this;
140139
}
@@ -192,37 +191,18 @@ public function getFormValues()
192191
* Extract the form values from attributes.
193192
*
194193
* @param array $attributes
195-
* @param int $storeId
196194
* @return array
197195
*/
198-
private function extractValuesFromAttributes(array $attributes, int $storeId): array
196+
private function extractValuesFromAttributes(array $attributes): array
199197
{
200198
$formValues = $this->getFormValues();
201199
foreach ($attributes as $code => $attribute) {
202200
$defaultValue = $attribute->getDefaultValue();
203201
if (isset($defaultValue) && !isset($formValues[$code])) {
204202
$formValues[$code] = $defaultValue;
205203
}
206-
if ($code === 'group_id' && empty($defaultValue)) {
207-
$formValues[$code] = $this->getDefaultCustomerGroup($storeId);
208-
}
209204
}
210205

211206
return $formValues;
212207
}
213-
214-
/**
215-
* Gets default customer group.
216-
*
217-
* @param int $storeId
218-
* @return string|null
219-
*/
220-
private function getDefaultCustomerGroup(int $storeId): ?string
221-
{
222-
return $this->_scopeConfig->getValue(
223-
'customer/create_account/default_group',
224-
ScopeInterface::SCOPE_STORE,
225-
$storeId
226-
);
227-
}
228208
}
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)