diff --git a/app/code/Magento/Elasticsearch/Model/Adapter/FieldMapper/Product/FieldProvider/DynamicField.php b/app/code/Magento/Elasticsearch/Model/Adapter/FieldMapper/Product/FieldProvider/DynamicField.php
index 181cbd4dfd4b3..268fe00e4c41e 100644
--- a/app/code/Magento/Elasticsearch/Model/Adapter/FieldMapper/Product/FieldProvider/DynamicField.php
+++ b/app/code/Magento/Elasticsearch/Model/Adapter/FieldMapper/Product/FieldProvider/DynamicField.php
@@ -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),
diff --git a/app/code/Magento/Elasticsearch6/etc/di.xml b/app/code/Magento/Elasticsearch6/etc/di.xml
index 25eff42fd3442..df71f3c3158d3 100644
--- a/app/code/Magento/Elasticsearch6/etc/di.xml
+++ b/app/code/Magento/Elasticsearch6/etc/di.xml
@@ -158,7 +158,7 @@
- - 2147483647
+ - 10000
diff --git a/app/code/Magento/Sales/Block/Adminhtml/Order/Create/Form/Account.php b/app/code/Magento/Sales/Block/Adminhtml/Order/Create/Form/Account.php
index c2a0eadf7b67a..03915c0499367 100644
--- a/app/code/Magento/Sales/Block/Adminhtml/Order/Create/Form/Account.php
+++ b/app/code/Magento/Sales/Block/Adminhtml/Order/Create/Form/Account.php
@@ -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;
}
diff --git a/app/code/Magento/Sales/Test/Mftf/Test/AdminChangeCustomerGroupInNewOrder.xml b/app/code/Magento/Sales/Test/Mftf/Test/AdminChangeCustomerGroupInNewOrder.xml
new file mode 100644
index 0000000000000..85ef563e10db7
--- /dev/null
+++ b/app/code/Magento/Sales/Test/Mftf/Test/AdminChangeCustomerGroupInNewOrder.xml
@@ -0,0 +1,38 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ $grabGroupValue
+ 3
+
+
+
diff --git a/app/code/Magento/Store/Test/Mftf/ActionGroup/DeleteCustomWebsiteActionGroup.xml b/app/code/Magento/Store/Test/Mftf/ActionGroup/DeleteCustomWebsiteActionGroup.xml
index cc6a1fb62ea5f..da3ce02a80f28 100644
--- a/app/code/Magento/Store/Test/Mftf/ActionGroup/DeleteCustomWebsiteActionGroup.xml
+++ b/app/code/Magento/Store/Test/Mftf/ActionGroup/DeleteCustomWebsiteActionGroup.xml
@@ -13,15 +13,14 @@
-
-
-
+
+
diff --git a/app/code/Magento/Store/Test/Mftf/Section/AdminStoresDeleteWebsiteSection.xml b/app/code/Magento/Store/Test/Mftf/Section/AdminStoresDeleteWebsiteSection.xml
index fea7dc07c8287..1bdf7f0c22c4e 100644
--- a/app/code/Magento/Store/Test/Mftf/Section/AdminStoresDeleteWebsiteSection.xml
+++ b/app/code/Magento/Store/Test/Mftf/Section/AdminStoresDeleteWebsiteSection.xml
@@ -8,6 +8,6 @@
diff --git a/dev/tests/setup-integration/_files/Magento/TestSetupDeclarationModule1/revisions/without_setup_version/module.xml b/dev/tests/setup-integration/_files/Magento/TestSetupDeclarationModule1/revisions/without_setup_version/module.xml
new file mode 100644
index 0000000000000..ed831eb6e9354
--- /dev/null
+++ b/dev/tests/setup-integration/_files/Magento/TestSetupDeclarationModule1/revisions/without_setup_version/module.xml
@@ -0,0 +1,10 @@
+
+
+
+
+
diff --git a/dev/tests/setup-integration/_files/Magento/TestSetupDeclarationModule3/revisions/drop_table_with_external_dependency/db_schema.xml b/dev/tests/setup-integration/_files/Magento/TestSetupDeclarationModule3/revisions/drop_table_with_external_dependency/db_schema.xml
new file mode 100644
index 0000000000000..c22c41b7a5c03
--- /dev/null
+++ b/dev/tests/setup-integration/_files/Magento/TestSetupDeclarationModule3/revisions/drop_table_with_external_dependency/db_schema.xml
@@ -0,0 +1,11 @@
+
+
+
+
+
diff --git a/dev/tests/setup-integration/_files/Magento/TestSetupDeclarationModule3/revisions/without_setup_version/module.xml b/dev/tests/setup-integration/_files/Magento/TestSetupDeclarationModule3/revisions/without_setup_version/module.xml
new file mode 100644
index 0000000000000..27e21dc3fe898
--- /dev/null
+++ b/dev/tests/setup-integration/_files/Magento/TestSetupDeclarationModule3/revisions/without_setup_version/module.xml
@@ -0,0 +1,10 @@
+
+
+
+
+
diff --git a/dev/tests/setup-integration/testsuite/Magento/Setup/DeclarativeInstallerTest.php b/dev/tests/setup-integration/testsuite/Magento/Setup/DeclarativeInstallerTest.php
index 6097348d4fabc..e8698965de007 100644
--- a/dev/tests/setup-integration/testsuite/Magento/Setup/DeclarativeInstallerTest.php
+++ b/dev/tests/setup-integration/testsuite/Magento/Setup/DeclarativeInstallerTest.php
@@ -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
diff --git a/lib/internal/Magento/Framework/Setup/Declaration/Schema/Declaration/SchemaBuilder.php b/lib/internal/Magento/Framework/Setup/Declaration/Schema/Declaration/SchemaBuilder.php
index 34a99f26a4ef1..4c65d8a70bed5 100644
--- a/lib/internal/Magento/Framework/Setup/Declaration/Schema/Declaration/SchemaBuilder.php
+++ b/lib/internal/Magento/Framework/Setup/Declaration/Schema/Declaration/SchemaBuilder.php
@@ -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']);