Skip to content

Commit

Permalink
Merge pull request #3891 from magento-arcticfoxes/2.3-develop-pr
Browse files Browse the repository at this point in the history
[2.3-develop] Sync with 2.3.1-release
  • Loading branch information
joanhe authored Mar 14, 2019
2 parents a4039fe + 9c276d7 commit 6d8e725
Show file tree
Hide file tree
Showing 11 changed files with 123 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -137,10 +137,12 @@ public function getFields(array $context = []): array
$searchCriteria = $this->searchCriteriaBuilder->create();
$groups = $this->groupRepository->getList($searchCriteria)->getItems();
$priceAttribute = $this->attributeAdapterProvider->getByAttributeCode('price');
$ctx = isset($context['websiteId']) ? ['websiteId' => $context['websiteId']] : [];
foreach ($groups as $group) {
$ctx['customerGroupId'] = $group->getId();
$groupPriceKey = $this->fieldNameResolver->getFieldName(
$priceAttribute,
['customerGroupId' => $group->getId(), 'websiteId' => $context['websiteId']]
$ctx
);
$allAttributes[$groupPriceKey] = [
'type' => $this->fieldTypeConverter->convert(FieldTypeConverterInterface::INTERNAL_DATA_TYPE_FLOAT),
Expand Down
2 changes: 1 addition & 1 deletion app/code/Magento/Elasticsearch6/etc/di.xml
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@
<type name="Magento\Search\Model\Search\PageSizeProvider">
<arguments>
<argument name="pageSizeBySearchEngine" xsi:type="array">
<item name="elasticsearch6" xsi:type="number">2147483647</item>
<item name="elasticsearch6" xsi:type="number">10000</item>
</argument>
</arguments>
</type>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -132,9 +132,7 @@ protected function _prepareForm()
$this->_addAttributesToForm($attributes, $fieldset);

$this->_form->addFieldNameSuffix('order[account]');

$formValues = $this->extractValuesFromAttributes($attributes);
$this->_form->setValues($formValues);
$this->_form->setValues($this->extractValuesFromAttributes($attributes));

return $this;
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
-->

<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd">
<test name="AdminChangeCustomerGroupInNewOrder">
<annotations>
<title value="Customer account group cannot be selected while creating a new customer in order"/>
<stories value="MC-15290: Customer account group cannot be selected while creating a new customer in order"/>
<description value="Customer account group cannot be selected while creating a new customer in order"/>
<severity value="MAJOR"/>
<testCaseId value="MC-15290"/>
<useCaseId value="MC-15289"/>
<group value="sales"/>
</annotations>

<before>
<actionGroup ref="LoginAsAdmin" stepKey="login"/>
</before>
<after>
<actionGroup ref="logout" stepKey="logout"/>
</after>

<actionGroup ref="navigateToNewOrderPageNewCustomerSingleStore" stepKey="openNewOrder"/>
<selectOption selector="{{AdminOrderFormAccountSection.group}}" userInput="Retailer" stepKey="selectCustomerGroup"/>
<waitForPageLoad stepKey="waitForPageLoad"/>
<grabValueFrom selector="{{AdminOrderFormAccountSection.group}}" stepKey="grabGroupValue"/>
<assertEquals stepKey="assertValueIsStillSelected">
<actualResult type="variable">$grabGroupValue</actualResult>
<expectedResult type="string">3</expectedResult>
</assertEquals>
</test>
</tests>
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,14 @@
</arguments>
<amOnPage url="{{AdminSystemStorePage.url}}" stepKey="amOnTheStorePage"/>
<click selector="{{AdminStoresGridSection.resetButton}}" stepKey="clickOnResetButton"/>
<waitForPageLoad stepKey="waitForPageLoadAfterResetButtonClicked" time="10"/>
<fillField userInput="{{websiteName}}" selector="{{AdminStoresGridSection.websiteFilterTextField}}" stepKey="fillSearchWebsiteField"/>
<click selector="{{AdminStoresGridSection.searchButton}}" stepKey="clickSearchButton" />
<waitForPageLoad stepKey="waitForPageLoadAfterSearch" time="10"/>
<see userInput="{{websiteName}}" selector="{{AdminStoresGridSection.websiteNameInFirstRow}}" stepKey="verifyThatCorrectWebsiteFound"/>
<click selector="{{AdminStoresGridSection.websiteNameInFirstRow}}" stepKey="clickEditExistingWebsite"/>

<waitForPageLoad stepKey="waitForPageLoadAfterWebsiteSelected" time="30"/>
<click selector="{{AdminStoresMainActionsSection.deleteButton}}" stepKey="clickDeleteWebsiteButtonOnEditStorePage"/>
<selectOption userInput="No" selector="{{AdminStoresDeleteWebsiteSection.createDbBackup}}" stepKey="setCreateDbBackupToNo"/>
<click selector="{{AdminStoresDeleteWebsiteSection.deleteButton}}" stepKey="clickDeleteButtonOnDeleteWebsitePage"/>
<see selector="{{AdminMessagesSection.successMessage}}" userInput="You deleted the website." stepKey="checkSuccessMessage"/>
</actionGroup>
</actionGroups>
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@
<sections xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd">
<section name="AdminStoresDeleteWebsiteSection">
<element name="createDbBackup" type="select" selector="#store_create_backup"/>
<element name="deleteButton" type="button" selector="#delete" timeout="30"/>
<element name="deleteButton" type="button" selector="#delete" timeout="120"/>
</section>
</sections>
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<?xml version="1.0"?>
<!--
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
-->
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd">
<module name="Magento_TestSetupDeclarationModule1"/>
</config>
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<?xml version="1.0"?>
<!--
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
-->
<schema xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:framework:Setup/Declaration/Schema/etc/schema.xsd">
<table name="reference_table" disabled="true"/>
</schema>
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<?xml version="1.0"?>
<!--
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
-->
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd">
<module name="Magento_TestSetupDeclarationModule3"/>
</config>
Original file line number Diff line number Diff line change
Expand Up @@ -249,6 +249,45 @@ public function testInstallationWithDroppingTables()
self::assertEquals($this->getData(), $shardData);
}

/**
* @moduleName Magento_TestSetupDeclarationModule1
* @moduleName Magento_TestSetupDeclarationModule3
*/
public function testInstallationWithDroppingTablesFromSecondaryModule()
{
$modules = [
'Magento_TestSetupDeclarationModule1',
'Magento_TestSetupDeclarationModule3',
];

$this->moduleManager->updateRevision(
'Magento_TestSetupDeclarationModule3',
'drop_table_with_external_dependency',
'db_schema.xml',
'etc'
);

foreach ($modules as $moduleName) {
$this->moduleManager->updateRevision(
$moduleName,
'without_setup_version',
'module.xml',
'etc'
);
}

try {
$this->cliCommand->install($modules);
} catch (\Exception $e) {
$installException = $e->getPrevious();
self::assertSame(1, $installException->getCode());
self::assertContains(
'The reference table named "reference_table" is disabled',
$installException->getMessage()
);
}
}

/**
* @moduleName Magento_TestSetupDeclarationModule1
* @dataProviderFromFile Magento/TestSetupDeclarationModule1/fixture/declarative_installer/rollback.php
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -350,6 +350,13 @@ private function processConstraints(array $tableData, string $resource, Schema $
if ($constraintData['type'] === 'foreign') {
$constraintData['column'] = $this->getColumnByName($constraintData['column'], $table);
$referenceTableData = $this->tablesData[$constraintData['referenceTable']];

if ($this->isDisabled($referenceTableData)) {
throw new \LogicException(
sprintf('The reference table named "%s" is disabled', $referenceTableData['name'])
);
}

//If we are referenced to the same table we need to specify it
//Get table name from resource connection regarding prefix settings
$refTableName = $this->resourceConnection->getTableName($referenceTableData['name']);
Expand Down

0 comments on commit 6d8e725

Please sign in to comment.